/// <summary> /// /// </summary> protected override void ValidateSelf() { if (_itsAssessActivity.ItsAssessStatus != AssessStatus.SummarizeCommment) { BllUtility.ThrowException(BllExceptionConst._InvalidStatus); } }
/// <summary> /// /// </summary> protected override void ExcuteSelf() { try { using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems) { item.Status = _RequestStatus; UpdateVacationDaysAvailable(item); UpdateAdjustHour(item); } _DalLeaveRequest.UpdateLeaveRequestItemStatusByLeaveRequestItemID(_LeaveRequestItemID, _RequestStatus, 0); _DalLeaveRequestFlow.InsertLeaveRequestFlow(PrepareLeaveRequestFlow(_LeaveRequestItemID)); ts.Complete(); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
/// <summary> /// 判断template表是否是一个完美的模板(包括item的数量必须满足一定条件) /// </summary> private bool CheckTemplatePapaer() { try { _ItsAssessTemplatePaper = _IAssessTemplatePaper.GetTempletPaperAndItemById(_AssessTempletPaperId); } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } if (_ItsAssessTemplatePaper == null) { BllUtility.ThrowException(BllExceptionConst._InvalidTemplateId); } if (_ItsAssessTemplatePaper.ItsAssessTemplateItems == null) { BllUtility.ThrowException(BllExceptionConst._AssessTemplateItem_Not_Exist); } if (_ItsAssessTemplatePaper.ItsAssessTemplateItems.Count == AAUtility._ItemsNotNull) { return(false); } return(true); }
protected override void Validation() { if (_IFeedBackPaper.CountFeedBackPaperByPaperName(_Paper.FeedBackPaperName) > 0) { BllUtility.ThrowException(BllExceptionConst._FeedBackPaper_Name_Repeat); } }
/// <summary> /// /// </summary> protected override void ExcuteSelf() { try { DiyStep currentStep = _PositionApplication.DiyProcess.FindCancelStep(); DiyStep nextStep = _PositionApplication.DiyProcess.FindCancelNextStep(); using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { _PositionApplicationDal.UpdatePositionApplicationStatusByPositionApplicationID(_PositionApplicationID, _RequestStatus, nextStep.DiyStepID); PositionApplicationFlow flow = new PositionApplicationFlow(0, _PositionApplicationID, new Account(_OperatorID, "", ""), DateTime.Now, _RequestStatus, _Reason, _PositionApplication); _PositionApplicationDal.InsertPositionApplicationFlow(flow); ts.Complete(); } List <string> accounts = new GetDiyProcess(_DalEmployeeDiyProcess).GetAccountMailListByDiyProcessIDAccountID( currentStep, _PositionApplication.Account.Id); new PositionApplicationMailAndPhoneDelegate().CancelMail(_PositionApplication.PKID, accounts, nextStep); } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
protected override void Validation() { if (_IAssessTemplatePaper.GetAssessTempletPaperById(_AssessPaperID) == null) { BllUtility.ThrowException(BllExceptionConst._AssessTemplatePaper_Not_Exist); } }
protected override void ExcuteSelf() { try { HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_ReimburseID); if (reimburseToUpdate.ReimburseFlows == null) { reimburseToUpdate.ReimburseFlows = new List <ReimburseFlow>(); } reimburseToUpdate.ReimburseFlows.Add( new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.Reimbursed)); reimburseToUpdate.ReimburseStatus = ReimburseStatusEnum.Reimbursed; // 记账时间 reimburseToUpdate.BillingTime = _BillingTime.ToString(); reimburseToUpdate.ExchangeRateID = _ExchangeRateID; using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { _DalReimburse.UpdateEmployeeReimburse(reimburseToUpdate); ts.Complete(); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
protected override void ValidateSelf() { if (_itsAssessActivity.ItsAssessStatus != AssessStatus.ApproveFilling) { BllUtility.ThrowException(BllExceptionConst._InvalidStatus); } }
private MailBody CreateMailBody() { MailBody mailBody = new MailBody(); mailBody.Subject = "您的【" + AssessActivityUtility.GetCharacterNameByType(_AssessActivity.AssessCharacterType) + " " + _AssessActivity.ScopeFrom.ToShortDateString() + "至" + _AssessActivity.ScopeTo.ToShortDateString() + "】已经结束,请登录系统查看评估表。"; StringBuilder sbMailBody = new StringBuilder(mailBody.Subject); mailBody.Body = sbMailBody.ToString(); Account account = BllInstance.AccountBllInstance.GetAccountById(_AssessActivity.ItsEmployee.Account.Id); List <Account> accounts = new List <Account>(); accounts.Add(account); List <List <string> > emails; emails = BllUtility.GetEmailsByAccountIds(accounts); mailBody.MailTo = emails[0]; mailBody.MailCc = emails[1]; return(mailBody); }
protected override void Validation() { if (_IFeedBackPaper.GetFeedBackPaperById(_PaperID) == null) { BllUtility.ThrowException(BllExceptionConst._FeedBackPaper_Not_Exist); } }
protected override void ExcuteSelf() { try { //_EmployeeReimburse = _DalReimburse.GetEmployeeReimburseByEmployeeID(_EmployeeID); //if (_EmployeeReimburse.Reimburses == null) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist); //} for (var i = 0; i < _ReimburseID.Count; i++) { HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_ReimburseID[i].ReimburseID); if (!ValidationEach(reimburseToUpdate)) { continue; } ReimburseDA.UpdateReimburseStatus(_ReimburseID[i].ReimburseID, ReimburseStatusEnum.Return); ReimburseFlowDA.Insert(new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.Return), _ReimburseID[i].ReimburseID); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
protected override void ExcuteSelf() { try { if (_TaxDal.GetTaxCutoffPoint() == -1) { _TaxDal.InsertTaxCutoffPoint(_TaxCutoffPoint); } else { _TaxDal.UpdateTaxCutoffPoint(_TaxCutoffPoint); } if (_TaxDal.GetForeignTaxCutoffPoint() == -1) { _TaxDal.InsertForeignTaxCutoffPoint(_TaxForeignCutoffPoint); } else { _TaxDal.UpdateForeignTaxCutoffPoint(_TaxForeignCutoffPoint); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
private bool ValidationEach(HRMISModel.Reimburse reimburseToUpdate) { try { if (reimburseToUpdate == null) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist); } else if (reimburseToUpdate.ReimburseStatus == ReimburseStatusEnum.Return) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Interruptted); } else if (reimburseToUpdate.ReimburseStatus == ReimburseStatusEnum.Reimbursed) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed); } else if (reimburseToUpdate.ReimburseStatus == ReimburseStatusEnum.Added) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Added); } //else if (reimburseToUpdate.ReimburseStatus == ReimburseStatusEnum.Cancel) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Canceled); //} return(true); } catch { FailCount++; return(false); } }
private void GetMailToCc(MailBody mailBody) { if (mailBody == null) { return; } List <List <string> > emails; List <Account> accounts; if (_AssessActivity.NextStepIndex != -1) { accounts = _AssessActivity.DiyProcess.DiySteps[_AssessActivity.NextStepIndex].MailAccount; Account nextOperator = new GetAssessActivity().GetDiyStepAccount(_AssessActivity.ItsEmployee.Account.Id, _AssessActivity.DiyProcess.DiySteps[ _AssessActivity.NextStepIndex]); if (nextOperator != null) { accounts.Add(nextOperator); } } else { Department dept = BllInstance.DepartmentBllInstance.GetDept(_AssessActivity.ItsEmployee.Account.Id, new Account(Account.AdminPkid, "", "")); accounts = new AuthDal().GetAccountsByAuthIdAndDeptId(HrmisPowers.A704, dept.Id); } emails = BllUtility.GetEmailsByAccountIds(accounts); mailBody.MailTo = emails[0]; mailBody.MailCc = emails[1]; return; }
protected override void Validation() { _EmployeeSalaryList = new List <EmployeeSalary>(); //获取所有员工 _EmployeeList = _GetEmployee.GetEmployeeWithCurrentMonthDimissionEmployee(_SalaryTime, _CompanyId, _DepartmentID); foreach (Employee employee in _EmployeeList) { //获取员工当月工资 EmployeeSalaryHistory salaryHistory = _DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(employee.Account.Id, _SalaryTime); //判断当月工资是否存在 if (salaryHistory == null) { throw new ApplicationException(employee.Account.Name + BllUtility.GetResourceMessage( BllExceptionConst._Employee_Salary_NotExist)); } //当月工资是否已封帐 if (Equals(salaryHistory.EmployeeSalaryStatus, EmployeeSalaryStatusEnum.AccountClosed)) { throw new ApplicationException(employee.Account.Name + BllUtility.GetResourceMessage( BllExceptionConst._Employee_Salary_Closed)); } var employeeSalary = new EmployeeSalary(employee.Account.Id); employeeSalary.Employee = employee; employeeSalary.EmployeeSalaryHistoryList = new List <EmployeeSalaryHistory>(); employeeSalary.EmployeeSalaryHistoryList.Add(salaryHistory); _EmployeeSalaryList.Add(employeeSalary); } }
protected override void Validation() { _EmployeeSalaryList = new List <EmployeeSalary>(); //获取所有员工 _EmployeeList = _GetEmployee.GetEmployeeWithCurrentMonthDimissionEmployee(_SalaryTime, _CompanyId, _DepartmentId); foreach (Employee employee in _EmployeeList) { EmployeeSalaryHistory salaryHistory = _DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(employee.Account.Id, _SalaryTime); //判断当月工资是否存在 if (salaryHistory == null) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_NotExist); } //判断当月工资状态是否没有封帐 else if (salaryHistory.EmployeeSalaryStatus != EmployeeSalaryStatusEnum.AccountClosed) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_Not_Closed); } var employeeSalary = new EmployeeSalary(employee.Account.Id); employeeSalary.Employee = employee; employeeSalary.EmployeeSalaryHistoryList = new List <EmployeeSalaryHistory>(); employeeSalary.EmployeeSalaryHistoryList.Add(salaryHistory); _EmployeeSalaryList.Add(employeeSalary); } }
protected override void Validation() { if(_DalRull.CountDutyClassByDutyClassName(_DutyClass.DutyClassName)>0) { BllUtility.ThrowException(BllExceptionConst._DutyClass_Name_Repeat); } }
protected override void ExcuteSelf() { try { using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew)) { _IAssessTemplatePaper.UpdateTemplatePaper(_Paper); _IAssessTemplatePaper.DeleteAllItemsInPaper(_Paper.AssessTemplatePaperID); foreach (AssessTemplateItem item in _Paper.ItsAssessTemplateItems) { if (item.AssessTemplateItemID != -1) { _IAssessTemplatePaper.ManagePaperItems(_Paper.AssessTemplatePaperID, item.AssessTemplateItemID, item.Weight); } } UpdateBindPosition(); ts.Complete(); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
/// <summary> /// /// </summary> public static string GetCharacterNameByType(AssessCharacterType assessCharacterType) { switch (assessCharacterType) { case AssessCharacterType.Normal: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterNormal)); case AssessCharacterType.NormalForContract: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterNormalForContract)); case AssessCharacterType.ProbationI: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterProbationI)); case AssessCharacterType.ProbationII: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterProbationII)); case AssessCharacterType.PracticeI: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterPracticeI)); case AssessCharacterType.PracticeII: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterPracticeII)); case AssessCharacterType.Abnormal: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterAbnormal)); case AssessCharacterType.Annual: return(BllUtility.GetResourceMessage(BllExceptionConst._CharacterAnnual)); default: return(""); } }
protected override void Validation() { //判断帐套参数是否为空 if (_AccountSet == null) { BllUtility.ThrowException(BllExceptionConst._EmployeeAccountSet_AccountSet_IsNull); } //判断数据库中装套是否存在 else if (_DalAccountSet.GetWholeAccountSetByPKID(_AccountSet.AccountSetID) == null) { BllUtility.ThrowException(BllExceptionConst._EmployeeAccountSet_AccountSet_NotExist); } //判断数据库中是否存在 EmployeeSalaryHistory history = _DalEmployeeSalary.GetEmployeeSalaryHistoryByPKID(_EmployeeSalaryID); if (history == null) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_NotExist); } //判断流程是否正在封帐阶段 else if (history.EmployeeSalaryStatus != EmployeeSalaryStatusEnum.AccountClosed) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_Not_Closed); } }
protected override void Validation() { if (!File.Exists(_FilePath)) { BllUtility.ThrowException(BllExceptionConst._Upload_Failed); } }
protected override void ExcuteSelf() { try { using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { _EmployeeReimburse.RemoveReimburseByReimburseID(_ReimburseID); if (reimburse.ReimburseFlows == null) { reimburse.ReimburseFlows = new List <ReimburseFlow>(); } reimburse.ReimburseFlows.Add( new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.Reimbursed)); reimburse.ReimburseStatus = ReimburseStatusEnum.Reimbursed; _EmployeeReimburse.Reimburses.Add(reimburse); _DalReimburse.UpdateEmployeeReimburse(_EmployeeReimburse); ts.Complete(); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
protected override void ExcuteSelf() { try { //_EmployeeReimburse = _DalReimburse.GetEmployeeReimburseByEmployeeID(_EmployeeID); //if (_EmployeeReimburse.Reimburses == null) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist); //} for (int i = 0; i < _ReimburseID.Count; i++) { HRMISModel.Reimburse reimburseToUpdate = _DalReimburse.GetReimburseByReimburseID(_ReimburseID[i].ReimburseID); if (!ValidationEach(reimburseToUpdate)) { continue; } using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { ReimburseDA.UpdateReimburseStatus(_ReimburseID[i].ReimburseID, ReimburseStatusEnum.WaitAudit); ReimburseFlowDA.Insert(new ReimburseFlow(_Operator, DateTime.Now, ReimburseStatusEnum.WaitAudit), _ReimburseID[i].ReimburseID); ts.Complete(); } } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
protected override void Validation() { _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID); if (_Reimburse == null) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Added) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Added); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursed) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Return) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Return); } //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Auditing) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Auditing); //} //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursing); //} }
protected override void ExcuteSelf() { try { Model.PayModule.AccountSet accountSet = _DalAccountSet.GetWholeAccountSetByPKID(_AccountSet.AccountSetID); if (accountSet != null && accountSet.Items != null) { for (int i = 0; i < accountSet.Items.Count; i++) { for (int j = 0; j < _AccountSet.Items.Count; j++) { if (accountSet.Items[i].AccountSetPara.AccountSetParaID == _AccountSet.Items[j].AccountSetPara.AccountSetParaID) { accountSet.Items[i].CalculateResult = _AccountSet.Items[j].CalculateResult; } } } } _AccountSet = accountSet; _AccountSet.Description = _Description; using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { _DalEmployeeAccountSet.UpdateEmployeeAccountSet(_EmployeeID, _AccountSet); _DalEmployeeAccountSet.InsertAdjustSalaryHistory(_EmployeeID, CreateAdjustSalaryHistory()); ts.Complete(); } } catch { BllUtility.ThrowException(BllExceptionConst._DbError); } }
/// <summary> /// 判断记录是否存在 /// </summary> protected override void Validation() { if (_DalReadRull.GetAttendanceReadRuleByPkid(_Read.AttendanceReadTimeId) == null) { BllUtility.ThrowException(BllExceptionConst._AttendanceReadRule_Not_Exist); } }
protected override void Validation() { //判断是否有重名 if (_DalAccountSet.CountAccountSetParaByNameDiffPKID(0, _AccountSetParaName) > 0) { BllUtility.ThrowException(BllExceptionConst._AccountSetParaName_Repeat); } }
protected override void Validation() { //判断是否已有相同下限的税阶,有则抛错 if (_TaxDal.GetTaxBandCountByBindMin(_BandMin) > 0) { BllUtility.ThrowException(BllExceptionConst._TaxBand_BindMin_Repeat); } }
protected override void Validation() { _AssessActivity = _Dal.GetAssessActivityById(_AssessActivityID); if (_AssessActivity == null) { BllUtility.ThrowException(BllExceptionConst._InvalidActivityId); } }
protected override void Validation() { if (_IAssessTemplatePaper.CountTemplatePaperByPaperName(_Paper.PaperName) > 0) { BllUtility.ThrowException(BllExceptionConst._AssessTemplatePaper_PaperName_Exist); } ValideBindPosition(); }