/// <summary> /// /// </summary> /// <param name="EmployeeRoleByType"></param> /// <returns></returns> public EmployeeRoleByType CreateEmployeeRoleByType(int employeeRoleTypeID, int employeeRoleID) { EmployeeRoleByType newEmployeeRoleByType = new EmployeeRoleByType(); newEmployeeRoleByType.EmployeeRoleTypeID = employeeRoleTypeID; newEmployeeRoleByType.EmployeeRoleID = employeeRoleID; return(CreateEmployeeRoleByType(newEmployeeRoleByType)); }
public EmployeeRoleByType UpdateEmployeeRoleByType(EmployeeRoleByType EmployeeRoleByType) { var c = ctx.EmployeeRoleByType.Where(x => x.ID == EmployeeRoleByType.ID).First(); if (c != null) { c.EmployeeRoleTypeID = EmployeeRoleByType.EmployeeRoleTypeID; c.EmployeeRoleID = EmployeeRoleByType.EmployeeRoleID; ctx.SaveChanges(); } return(c); }
/// <summary> /// Create EmployeeRoleByType and at least one EmployeeRoleByType sign in. /// </summary> /// <param name="EmployeeRoleByType"></param> /// <returns></returns> public EmployeeRoleByType CreateEmployeeRoleByType(EmployeeRoleByType EmployeeRoleByType) { ctx.EmployeeRoleByType.Add(EmployeeRoleByType); ctx.SaveChanges(); return(EmployeeRoleByType); }