本文整理汇总了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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}