public ProcessResult Insert(Department newDepartment) { ProcessResult result = VerifeyModel(newDepartment); if (result.Result != Extensions.BLLResult.Verified) { return(result); } DAL.Extensions.DataBaseResult insert = _departmentDal.Insert(newDepartment); switch (insert) { case DAL.Extensions.DataBaseResult.AlreadyFound: result.Result = Extensions.BLLResult.AlreadyFound; result.Errors.Add(Extensions.AlreadyFoundString(newDepartment.Name)); break; case DAL.Extensions.DataBaseResult.Error: result.Result = Extensions.BLLResult.InnerException; result.Errors.Add(Extensions.InnerException); break; case DAL.Extensions.DataBaseResult.Success: result.Result = Extensions.BLLResult.Success; result.Errors.Add(Extensions.SuccessProcess); break; case DAL.Extensions.DataBaseResult.ServerDisable: result.Result = Extensions.BLLResult.ServerDisable; result.Errors.Add(Extensions.ServerDisable); break; case DAL.Extensions.DataBaseResult.Referanced: break; case DAL.Extensions.DataBaseResult.NotFound: break; default: throw new ArgumentOutOfRangeException(); } return(result); }