public void Add(Dpartment dept) { var addDept = context.Departments .Add(dept); context.SaveChanges(); }
public void UpdateDepartment(Dpartment dept) { var update = context.Departments.Find(dept.ID); update.DeptName = dept.DeptName; update.Location = dept.Location; context.SaveChanges(); }
public void EditDepartment(EditViewModel evm) { Dpartment department = new Dpartment { ID = evm.Id, DeptName = evm.DeptName, Location = evm.Location }; _repo.UpdateDepartment(department); }
public void AddDept(AddViewModel avm) { Dpartment department = new Dpartment { DeptName = avm.DeptName, Location = avm.Location }; // department.ID = avm.ID; _repo.Add(department); }