• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TimeTrackerEntities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TimeTrackerEntities的典型用法代码示例。如果您正苦于以下问题:C# TimeTrackerEntities类的具体用法?C# TimeTrackerEntities怎么用?C# TimeTrackerEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimeTrackerEntities类属于命名空间,在下文中一共展示了TimeTrackerEntities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetDefaultBreak

        public JobType GetDefaultBreak()
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from j in db.T_JobType
                        where j.IsDefaultBreak == true
                        select new JobType()
                        {
                            Id = j.Id,
                            Description = j.Description,
                            CreatedBy = j.CreatedBy,
                            LastUpdatedBy = j.LastUpdatedBy,
                            CreateDate = j.CreateDate,
                            LastUpdateDate = j.LastUpdateDate,
                            RequiredJobId = j.RequiredJobId,
                            ComputeTime = j.ComputeTime,
                            Position = j.Position,
                            ShowInJobOverview = j.ShowInJobOverview,
                            Acronym = j.Acronym,
                            IsDefaultBreak = j.IsDefaultBreak
                        }).FirstOrDefault();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:26,代码来源:JobType.cs


示例2: GetExclusiveJobTypeList

        public List<JobType> GetExclusiveJobTypeList(int departmentid)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from j in db.T_JobTypeDepartment
                        where j.DepartmentId == departmentid
                        orderby j.M_Department.Position, j.Position
                        select new JobType()
                        {
                            Id = j.JobTypeId,
                            Description = j.M_JobType.Description,
                            CreatedBy = j.M_JobType.CreatedBy,
                            LastUpdatedBy = j.M_JobType.LastUpdatedBy,
                            CreateDate = j.M_JobType.CreateDate,
                            LastUpdateDate = j.M_JobType.LastUpdateDate,
                            RequiredJobId = j.M_JobType.RequiredJobId,
                            ComputeTime = j.M_JobType.ComputeTime,
                            Position = j.Position,
                            ShowInJobOverview = j.M_JobType.ShowInJobOverview,
                            Acronym = j.M_JobType.Acronym
                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:26,代码来源:JobTypeDepartment.cs


示例3: GetAvailableJobTypeForJobFlow

        public List<JobType> GetAvailableJobTypeForJobFlow()
        {
            TimeTrackerEntities db = new TimeTrackerEntities();
            Department dept = new Department();
            var deptlist = dept.GetDepartmentList();
            int deptCount = deptlist.Count;
            var data = (from j in db.T_JobType
                        where j.M_JobTypeFlows.Count < deptCount
                        orderby j.Position
                        select new JobType()
                        {
                            Id = j.Id,
                            Description = j.Description,
                            CreatedBy = j.CreatedBy,
                            LastUpdatedBy = j.LastUpdatedBy,
                            CreateDate = j.CreateDate,
                            LastUpdateDate = j.LastUpdateDate,
                            RequiredJobId = j.RequiredJobId,
                            ComputeTime = j.ComputeTime,
                            Position = j.Position,
                            ShowInJobOverview = j.ShowInJobOverview,
                            Acronym = j.Acronym,
                            IsDefaultBreak = j.IsDefaultBreak
                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:29,代码来源:JobType.cs


示例4: GetDepartmentListByJobTypeId

        public List<JobTypeFlow> GetDepartmentListByJobTypeId(int jobtypeid)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from j in db.T_JobTypeFlow
                        where j.JobTypeId == jobtypeid
                        && j.DepartmentId != null
                        orderby j.Position
                        select new JobTypeFlow()
                        {
                            Id = j.Id,
                            JobTypeId = j.JobTypeId,
                            JobFlowId = j.JobFlowId,
                            Position = j.Position,
                            DepartmentId = j.DepartmentId,
                            jobtype = j.M_JobType.Description,
                            requiredJobId = j.M_JobType.RequiredJobId,
                            computeTime = j.M_JobType.ComputeTime,
                            showInJobOverview = j.M_JobType.ShowInJobOverview,
                            jobtypeAcronym = j.M_JobType.Acronym,
                            jobflow = j.M_JobFlow.Description,
                            jobflowAcronym = j.M_JobFlow.Acronym,
                            department = j.M_Department.Description,
                            departmentAcronym = j.M_Department.Acronym

                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:31,代码来源:JobTypeFlow.cs


示例5: GetCapStageMapping

        public CAPStageMapping GetCapStageMapping(int departmentId,int jobtypeId,int sd_stage_no,string databasemap)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from c in db.T_CAPStageMapping
                        where c.DepartmentId == departmentId
                        && c.JobTypeId == jobtypeId
                        && c.SD_Stage_No == sd_stage_no
                        && c.DatabaseMap == databasemap
                        select new CAPStageMapping()
                        {
                            Id = c.Id,
                            DepartmentId = c.DepartmentId,
                            JobTypeId = c.JobTypeId,
                            SD_Stage_No = c.SD_Stage_No,
                            DatabaseMap = c.DatabaseMap,
                            StageDescription = c.StageDescription,
                            department = c.M_Department.Description,
                            jobtype = c.M_JobType.Description
                        }).FirstOrDefault();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:25,代码来源:CAPStageMapping.cs


示例6: GetStartEndTime

        public TimeClock GetStartEndTime(int userid, DateTime selectedDate)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();
            TimeClock result = new TimeClock();
            User user = new User();

            user = user.GetUser(userid);

            //DateTime stime = Convert.ToDateTime(selectedDate.ToString("yyyy-MM-dd") + " 00:00");
            //DateTime etime = Convert.ToDateTime(selectedDate.ToString("yyyy-MM-dd") + " 23:59");
            DateTime stime = new DateTime();
            DateTime etime = new DateTime();
            TimeSpan startTime = new TimeSpan();
            TimeSpan endTime = new TimeSpan();
            TimeSpan.TryParse(user.startTime == "" ? "08:00":user.startTime, out startTime);
            TimeSpan.TryParse(user.endTime == "" ? "17:00":user.endTime, out endTime);
            if (startTime > endTime)
            {

            }
            var data = (from t in db.T_TimeClock
                        where t.EmployeeNumber == user.EmployeeNumber
                        && t.ScanTime >= stime
                        && t.ScanTime <= etime
                        orderby t.ScanTime ascending
                        select new TimeClock()
                        {
                            Id = t.Id,
                            EmployeeNumber = t.EmployeeNumber,
                            ScanTime = t.ScanTime,
                            CreateDate = t.CreateDate,
                            Filename = t.Filename
                        }).ToList();

            db.Dispose();
            result.starttime = DateTime.Now.AddYears(1);
            for (int i = 0; i < data.Count; i++)
            {
                if (i % 2 == 0)
                {
                    if (result.starttime == null || result.starttime > data[i].ScanTime)
                        result.starttime = data[i].ScanTime;
                }
                else
                {
                    if (result.endtime == null || result.endtime < data[i].ScanTime)
                        result.endtime = data[i].ScanTime;
                }
            }

            return data.Count < 2 ? null : result;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:52,代码来源:TimeClock.cs


示例7: GetRoleDepartmentList

        public List<RoleDepartmentAccess> GetRoleDepartmentList()
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from p in db.T_RoleDepartmentAccess
                        select new RoleDepartmentAccess()
                        {
                            Id = p.Id,
                            RoleId = p.RoleId,
                            DepartmentId = p.DepartmentId
                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:16,代码来源:RoleDepartmentAccess.cs


示例8: Update

 public void Update(TimeSetting timesetting)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_TimeSetting t_timesetting = db.T_TimeSetting.FirstOrDefault();
             Parse(t_timesetting, timesetting);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:16,代码来源:TimeSetting.cs


示例9: Delete

 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_RolesModuleAccess t_rolemoduleaccess = new T_RolesModuleAccess();
             t_rolemoduleaccess = db.T_RolesModuleAccess.FirstOrDefault(p => p.Id == id);
             db.T_RolesModuleAccess.Remove(t_rolemoduleaccess);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:RolesModuleAccess.cs


示例10: Insert

 public void Insert(JobTrackerHistory jtHist)
 {
     T_JobTrackerHistory j = new T_JobTrackerHistory();
     ParseJobTracker(j, jtHist);
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             db.T_JobTrackerHistory.Add(j);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:JobTrackerHistory.cs


示例11: Delete

 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_JobTrackerHistory t_jthist = new T_JobTrackerHistory();
             t_jthist = db.T_JobTrackerHistory.FirstOrDefault(j => j.Id == id);
             db.T_JobTrackerHistory.Remove(t_jthist);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:JobTrackerHistory.cs


示例12: GetTimeSettingList

        public List<TimeSetting> GetTimeSettingList()
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from t in db.T_TimeSetting
                        select new TimeSetting()
                        {
                            Id = t.Id,
                            Interval = t.Interval,
                            LastUpdateDate = t.LastUpdateDate,
                            LastUpdatedBy = t.LastUpdatedBy
                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:TimeSetting.cs


示例13: Delete

 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_JobTypeFlow t_jobtypeflow = new T_JobTypeFlow();
             t_jobtypeflow = db.T_JobTypeFlow.FirstOrDefault(j => j.Id == id);
             db.T_JobTypeFlow.Remove(t_jobtypeflow);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:JobTypeFlow.cs


示例14: Delete

 //Delete user in the database
 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_UserRateSchedule t_userRateSchedule = new T_UserRateSchedule();
             t_userRateSchedule = db.T_UserRateSchedule.FirstOrDefault(u => u.Id == id);
             db.T_UserRateSchedule.Remove(t_userRateSchedule);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:UserRateSchedule.cs


示例15: Delete

 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_SupervisorMapping t_rs = new T_SupervisorMapping();
             t_rs = db.T_SupervisorMapping.FirstOrDefault(p => p.Id == id);
             db.T_SupervisorMapping.Remove(t_rs);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:SupervisorMapping.cs


示例16: Delete

 //Delete a department in the database
 public void Delete(int id)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_Department t_department = new T_Department();
             t_department = db.T_Department.FirstOrDefault(d => d.Id == id);
             db.T_Department.Remove(t_department);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:Department.cs


示例17: GetHolidays

        public List<Holiday> GetHolidays(int year)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from d in db.T_Holiday
                        where d.HolidayYear == year
                        select new Holiday()
                        {
                            Id = d.Id,
                            HolidayYear = d.HolidayYear,
                            HolidayDate = d.HolidayDate,
                            Description = d.Description,
                        }).ToList();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:Holiday.cs


示例18: GetTimeSetting

        public TimeSetting GetTimeSetting(int id)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from t in db.T_TimeSetting
                        where t.Id == id
                        select new TimeSetting()
                        {
                            Id = t.Id,
                            Interval = t.Interval,
                            LastUpdateDate = t.LastUpdateDate,
                            LastUpdatedBy = t.LastUpdatedBy
                        }).FirstOrDefault();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:TimeSetting.cs


示例19: GetHoliday

        public Holiday GetHoliday(DateTime date)
        {
            TimeTrackerEntities db = new TimeTrackerEntities();

            var data = (from d in db.T_Holiday
                        where d.HolidayDate == date
                        select new Holiday()
                        {
                            Id = d.Id,
                            HolidayYear = d.HolidayYear,
                            HolidayDate = d.HolidayDate,
                            Description = d.Description,
                        }).FirstOrDefault();

            db.Dispose();

            return data;
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:Holiday.cs


示例20: Insert

        public void Insert(RoleDepartmentAccess roledepartmentaccess)
        {
            T_RoleDepartmentAccess t_roledepartmentaccess = new T_RoleDepartmentAccess();
            Parse(t_roledepartmentaccess, roledepartmentaccess);

            using (TimeTrackerEntities db = new TimeTrackerEntities())
            {
                try
                {
                    db.T_RoleDepartmentAccess.Add(t_roledepartmentaccess);
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    string msg = ex.Message;
                }
            }
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:18,代码来源:RoleDepartmentAccess.cs



注:本文中的TimeTrackerEntities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TimeUnit类代码示例发布时间:2022-05-24
下一篇:
C# TimeStep类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap