Beispiel #1
0
 public static DepartmentModel Convert(Department department)
 {
     DepartmentModel departmentModel = new DepartmentModel();
     if(department != null)
     {
         departmentModel.Name = department.Name;
         departmentModel.Id = department.Id;
         departmentModel.Employees = EmployeeConverter.Convert(department.Employees.ToList());
     }
     return departmentModel;
 }
Beispiel #2
0
 public Department ToDepartment(Department d, DepartmentModel d1)
 {
     return(d = new Department {
         ID = d1.ID, Name = d1.Name
     });
 }
Beispiel #3
0
 public void DeleteDepartment(DepartmentModel d)
 {
     db.Departments.Remove(db.Departments.Find(d.ID));
 }
Beispiel #4
0
 public void AddDepartment(DepartmentModel d)
 {
     db.Departments.Add(ToDepartment(new Department(), d));
 }