コード例 #1
0
 public void AddNewDepartment(Department productDeparment)
 {
     try
     {
         _departmentRepository.Add(productDeparment);
         //_uow.Save();
     }
     catch (Exception ex)
     {
         throw new Exception("Failed adding the department", ex);
     }
 }
コード例 #2
0
        public void UpdateDepartment(Department department)
        {
            try
            {
                //ProductCategory category = _categoryRepository.GetAll().FirstOrDefault(i => i.Id == id);
                //category.DepartmentId = 1;

                _departmentRepository.Update(department);
                _uow.Save();
            }
            catch (Exception ex)
            {
                throw new Exception("Failed updating the department", ex);
            }
        }