/// <summary> /// /// </summary> /// <param name="EmployeeRoleType"></param> /// <returns></returns> public EmployeeRoleType CreateEmployeeRoleType(string EmployeeRoleType) { EmployeeRoleType newEmployeeRoleType = new EmployeeRoleType(); newEmployeeRoleType.Name = EmployeeRoleType; return(CreateEmployeeRoleType(newEmployeeRoleType)); }
public EmployeeRoleType UpdateEmployeeRoleType(EmployeeRoleType EmployeeRoleType) { var c = ctx.EmployeeRoleType.Where(x => x.ID == EmployeeRoleType.ID).First(); if (c != null) { c.Name = EmployeeRoleType.Name; ctx.SaveChanges(); } return(c); }
/// <summary> /// Create EmployeeRoleType and at least one EmployeeRoleType sign in. /// </summary> /// <param name="EmployeeRoleType"></param> /// <returns></returns> public EmployeeRoleType CreateEmployeeRoleType(EmployeeRoleType EmployeeRoleType) { ctx.EmployeeRoleType.Add(EmployeeRoleType); ctx.SaveChanges(); return(EmployeeRoleType); }