当前位置: 首页>>代码示例>>C#>>正文


C# TimeTrackerEntities.SaveChanges方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: Update

        public void Update(JobTypeFlow jobtypeflow)
        {
            using (TimeTrackerEntities db = new TimeTrackerEntities())
            {
                try
                {
                    T_JobTypeFlow t_jobtypeflow = db.T_JobTypeFlow.FirstOrDefault(f => f.Id == jobtypeflow.Id);
                    Parse(t_jobtypeflow, jobtypeflow);

                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    string msg = ex.Message;
                }
            }
        }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:JobTypeFlow.cs

示例10: Update

 //Update User record in the database
 public void Update(User user)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_Users t_user = db.T_Users.FirstOrDefault(u => u.Id == user.Id);
             UpdateParse(t_user, user);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:17,代码来源:User.cs

示例11: Insert

        public void Insert(JobTypeFlow jobtypeflow)
        {
            T_JobTypeFlow t_jobtypeflow = new T_JobTypeFlow();
            Parse(t_jobtypeflow, jobtypeflow);

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

示例12: Update

 public void Update(JobType jobtype)
 {
     using (TimeTrackerEntities db = new TimeTrackerEntities())
     {
         try
         {
             T_JobType t_jobtype = db.T_JobType.FirstOrDefault(d => d.Id == jobtype.Id);
             UpdateParse(t_jobtype, jobtype);
             db.SaveChanges();
         }
         catch (Exception ex)
         {
             string msg = ex.Message;
         }
     }
 }
开发者ID:ECTProgrammer,项目名称:ECTSampleRepository,代码行数:16,代码来源:JobType.cs

示例13: Insert

        //Insert User in the database
        public void Insert(User user)
        {
            T_Users t_user = InsertParse(user);

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

示例14: Update

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

示例15: Insert

        public void Insert(JobTypeDepartment jobtypedepartment)
        {
            T_JobTypeDepartment t_jobtypedepartment = new T_JobTypeDepartment();
            t_jobtypedepartment.JobTypeId = jobtypedepartment.JobTypeId;
            t_jobtypedepartment.DepartmentId = jobtypedepartment.DepartmentId;
            t_jobtypedepartment.Position = jobtypedepartment.Position;

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


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