public void UpdateEmployee(Employee employee) { Employee emp = entities.Employees.FirstOrDefault(e => e.EmployeeID == employee.EmployeeID); emp.EmployedDate = employee.EmployedDate; emp.EmployeeNum = employee.EmployeeNum; emp.TerminatedDate = employee.TerminatedDate; entities.SaveChanges(); }
public void UpdateEmployee(Employee employee) { new DataAccess().UpdateEmployee(employee); }
public void AddEmployee(Employee employee) { new DataAccess().SaveEmployee(employee); }
public void SaveEmployee(Employee employee) { entities.Employees.AddObject(employee); entities.SaveChanges(); }
/// <summary> /// Create a new Employee object. /// </summary> /// <param name="employeeID">Initial value of the EmployeeID property.</param> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="employeeNum">Initial value of the EmployeeNum property.</param> /// <param name="employedDate">Initial value of the EmployedDate property.</param> /// <param name="terminatedDate">Initial value of the TerminatedDate property.</param> public static Employee CreateEmployee(global::System.Int32 employeeID, global::System.Int32 personID, global::System.String employeeNum, global::System.DateTime employedDate, global::System.DateTime terminatedDate) { Employee employee = new Employee(); employee.EmployeeID = employeeID; employee.PersonID = personID; employee.EmployeeNum = employeeNum; employee.EmployedDate = employedDate; employee.TerminatedDate = terminatedDate; return employee; }
/// <summary> /// Deprecated Method for adding a new object to the Employees EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEmployees(Employee employee) { base.AddObject("Employees", employee); }