public ProcessResult Delete(int id) { ProcessResult result = new ProcessResult(); DAL.Extensions.DataBaseResult delete = _departmentDal.Delete(id); switch (delete) { case DAL.Extensions.DataBaseResult.Success: result.Result = Extensions.BLLResult.Success; result.Errors.Add(Extensions.SuccessProcess); break; case DAL.Extensions.DataBaseResult.Referanced: result.Result = Extensions.BLLResult.Referanced; result.Errors.Add("Departman başka tablolar üzerinde refere edildiğinden silinemedi"); break; case DAL.Extensions.DataBaseResult.NotFound: result.Result = Extensions.BLLResult.NotFound; result.Errors.Add(Extensions.NotFound); break; case DAL.Extensions.DataBaseResult.Error: result.Result = Extensions.BLLResult.InnerException; result.Errors.Add(Extensions.InnerException); break; case DAL.Extensions.DataBaseResult.ServerDisable: result.Result = Extensions.BLLResult.ServerDisable; result.Errors.Add(Extensions.ServerDisable); break; case DAL.Extensions.DataBaseResult.AlreadyFound: break; default: throw new ArgumentOutOfRangeException(); } return(result); }
/// <summary> /// 删除 /// </summary> /// <param name="iDeptID"></param> /// <returns></returns> public MessageEntity Delete(int iDeptID) { return(_departmentDAL.Delete(new P_Department { iDeptID = iDeptID })); }
/// <summary> /// 删除 /// </summary> /// <param name="model">实体</param> public void Delete(Department model) { dal.Delete <Department>(model); }