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> /// 复制事件,将AccountSet对象,付给SessionCopyAccountSet /// </summary> public void btnCopyEvent() { Model.PayModule.AccountSet accountSet = new Model.PayModule.AccountSet(0, _IAccountSetView.AccountSetName); List <AccountSetItem> accountSetItems = _IAccountSetView.AccountSetItemList; accountSet.Items = accountSetItems; accountSet.Description = _IAccountSetView.Description; _IAccountSetView.SessionCopyAccountSet = accountSet; }
public UpdateEmployeeAccountSet(int employeeID, Model.PayModule.AccountSet accountSet, string backAccountsName, DateTime changeDate, string description) { _EmployeeID = employeeID; _AccountSet = accountSet; _BackAccountsName = backAccountsName; _ChangeDate = changeDate; _Description = description; }
public AccountReopenedEmployeeAccountSet(int salaryId, int employeeID, DateTime dt, Model.PayModule.AccountSet accountSet, string backAcountsName, string description, int versionNum) { _EmployeeSalaryID = salaryId; _EmployeeID = employeeID; _SalaryTime = dt; _Description = description; _AccountSet = accountSet; _BackAccountsName = backAcountsName; _VersionNum = versionNum; }
public Model.PayModule.AccountSet GetAccountSet(string name) { Model.PayModule.AccountSet accountSet = _IAccountSetFacade.GetAccountSetByName(name); if (accountSet != null) { return(_IAccountSetFacade.GetWholeAccountSetByPKID(accountSet.AccountSetID)); } return(null); }
public TemporarySaveEmployeeAccountSet(int salaryId, int employeeID, DateTime dt, Model.PayModule.AccountSet accountSet, string backAcountsName, string description, int versionNum) { _EmployeeSalaryID = salaryId; _EmployeeID = employeeID; //_SalaryTime = Convert.ToDateTime(dt.Year + "-" + dt.Month); _SalaryTime = dt; _Description = description; _AccountSet = accountSet; _BackAccountsName = backAcountsName; _VersionNum = versionNum; }
public CreateEmployeeAccountSet(int employeeID, Model.PayModule.AccountSet accountSet, string backAccountsName, DateTime changeDate, string description, IAccountSet mockAccountSet, IEmployeeAccountSet mockEmployeeAccountSet) { _EmployeeID = employeeID; _AccountSet = accountSet; _BackAccountsName = backAccountsName; _ChangeDate = changeDate; _Description = description; _DalAccountSet = mockAccountSet; _DalEmployeeAccountSet = mockEmployeeAccountSet; }
public TemporarySaveEmployeeAccountSet(int salaryId, int employeeID, DateTime dt, Model.PayModule.AccountSet accountSet, string backAcountsName, string description, int versionNum, IEmployeeSalary mockSalary, IAccountSet mockaccountSet) { _EmployeeSalaryID = salaryId; _EmployeeID = employeeID; _SalaryTime = dt; _Description = description; _AccountSet = accountSet; _BackAccountsName = backAcountsName; _VersionNum = versionNum; _DalEmployeeSalary = mockSalary; _DalAccountSet = mockaccountSet; }
private EmployeeSalaryHistory MakeEmployeeSalaryWithoutAccountSet() { EmployeeSalaryHistory salaryHistory = new EmployeeSalaryHistory(); Model.PayModule.AccountSet temp = new Model.PayModule.AccountSet(0, string.Empty); salaryHistory.EmployeeAccountSet = temp; salaryHistory.Description = _Description; salaryHistory.SalaryDateTime = _SalaryTime; salaryHistory.EmployeeSalaryStatus = EmployeeSalaryStatusEnum.TemporarySave; salaryHistory.AccountsBackName = _BackAccountsName; return(salaryHistory); }
public void DataBind(Model.PayModule.AccountSet theDataToBind) { try { _IAccountSetView.AccountSetName = theDataToBind.AccountSetName; _IAccountSetView.Description = theDataToBind.Description; _IAccountSetView.AccountSetItemList = theDataToBind.Items; } catch { _IAccountSetView.Message = "绑定信息失败"; } }
public void DataBind(int accountSetId) { try { Model.PayModule.AccountSet theDataToBind = _IAccountSetFacade.GetWholeAccountSetByPKID(accountSetId); _IAccountSetView.AccountSetName = theDataToBind.AccountSetName; _IAccountSetView.Description = theDataToBind.Description; _IAccountSetView.AccountSetItemList = theDataToBind.Items; } catch { _IAccountSetView.Message = "初始化信息失败"; } }
private static void MergeAccountSetData(Model.PayModule.AccountSet accountSet, Model.PayModule.AccountSet employeeSalaryAccountSet) { foreach (AccountSetItem employeeSalaryAccountSetItem in employeeSalaryAccountSet.Items) { foreach (AccountSetItem accountSetItem in accountSet.Items) { if (employeeSalaryAccountSetItem.AccountSetPara.AccountSetParaID == accountSetItem.AccountSetPara.AccountSetParaID) { accountSetItem.CalculateResult = employeeSalaryAccountSetItem.CalculateResult; break; } } } }
private bool Validation() { try { AccountSet = _ItsView.AccountSet; return(true); } catch { _ItsView.ResultMessage = //" <img src='../../../Pages/image/icon03.jpg' align='absmiddle'' /> <span class='fontred'> "输入格式不正确";//</span>"; return(false); } }
private Model.PayModule.AccountSet MakeAccountSet() { Model.PayModule.AccountSet retAccountSet = new Model.PayModule.AccountSet(0, _AccountSetName); retAccountSet.Description = _Description; retAccountSet.Items = new List <AccountSetItem>(); if (_AccountSetItems != null) { foreach (AccountSetItem item in _AccountSetItems) { retAccountSet.Items.Add(item); } } _AccountSetTest = retAccountSet; return(retAccountSet); }
protected override void Validation() { //判断是否存在帐套 _OldAccountSet = _DalAccountSet.GetWholeAccountSetByPKID(_AccountSetID); if (_OldAccountSet == null) { BllUtility.ThrowException(BllExceptionConst._AccountSet_IsNotExist); } //判断是否重名 if (_DalAccountSet.CountAccountSetByNameDiffPKID(_AccountSetID, _AccountSetName) > 0) { BllUtility.ThrowException(BllExceptionConst._AccountSetName_Repeat); } //判断Items是否实例化 if (_AccountSetItems == null) { _AccountSetItems = new List <AccountSetItem>(); } foreach (AccountSetItem item in _AccountSetItems) { //判断Para是否实例化 if (item.AccountSetPara == null) { BllUtility.ThrowException(BllExceptionConst._AccountSetPara_IsNull); } //判断Para的字段属性是否实例化 if (item.AccountSetPara.FieldAttribute == null) { BllUtility.ThrowException(BllExceptionConst._AccountSetPara_FieldAttribute_IsNull); } //判断计算类型的字段是否已填写公式 if (item.AccountSetPara.FieldAttribute.Id == FieldAttributeEnum.CalculateField.Id && string.IsNullOrEmpty(item.CalculateFormula)) { BllUtility.ThrowException(BllExceptionConst._AccountSet_CalculateFormula_IsNull); } //判断绑定值类型的字段是否已填写绑定值 if (item.AccountSetPara.FieldAttribute.Id == FieldAttributeEnum.BindField.Id && item.AccountSetPara.BindItem.Id == BindItemEnum.NoBindItem.Id) { BllUtility.ThrowException(BllExceptionConst._AccountSet_BindItem_IsNull); } //判断para是否存在 if (_DalAccountSet.GetAccountSetParaByPKID(item.AccountSetPara.AccountSetParaID) == null) { BllUtility.ThrowException(BllExceptionConst._AccountSetPara_IsNotExist); } } //判断是否有重复的Para被定义 for (int i = 0; i < _AccountSetItems.Count; i++) { for (int j = i + 1; j < _AccountSetItems.Count; j++) { if (_AccountSetItems[i].AccountSetPara.AccountSetParaID == _AccountSetItems[j].AccountSetPara.AccountSetParaID) { BllUtility.ThrowException( BllExceptionConst._AccountSet_UseRepeatPara); } } } //判断表达式是否正确 try { MakeAccountSet().CheckItemListValidation(); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
public void TemporarySaveEvent(int salaryId, int employeeID, DateTime dt, Model.PayModule.AccountSet accountSet, string backAcountsName, string description, int versionNum) { _IEmployeeAccountSetFacade.TemporarySaveEmployeeAccountSetFacadeFacade(salaryId, employeeID, dt, accountSet, backAcountsName, description, versionNum); }