private void DeleteEvent() { try { if (CompanyConfig.HasHrmisSystem && new CompanyInvolveFacade().GetEmployeeBasicInfoByCompanyID(Convert.ToInt32(_ItsView.DepartmentID)).Count > 0) { throw new ApplicationException("该公司下存在员工,禁止删除!"); } using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { _DepartmentBll.DeleteDept(Convert.ToInt32(_ItsView.DepartmentID), _LoginUser); IDepartmentHistoryFacade hrmisDepartmentHistoryFacade = new DepartmentHistoryFacade(); hrmisDepartmentHistoryFacade.AddDepartmentHistory(_LoginUser); ts.Complete(); } _ItsView.ActionSuccess = true; } catch (ApplicationException ae) { _ItsView.Message = ae.Message; } }