Beispiel #1
0
        /// <summary>
        /// 组装数据
        /// </summary>
        /// <returns></returns>
        private EmployeeSalaryHistory MakeEmployeeSalary()
        {
            EmployeeSalaryHistory salaryHistory = new EmployeeSalaryHistory();

            salaryHistory.EmployeeAccountSet = _AccountSet;
            salaryHistory.HistoryId          = _EmployeeSalaryID;
            if (_AccountSet != null && _AccountSet.Items != null)
            {
                BindItemValueCollection _BindItemValueCollection = ExecutBindValue(_EmployeeID, _SalaryTime);
                //获取绑定值
                foreach (AccountSetItem item in _AccountSet.Items)
                {
                    if (item != null && item.AccountSetPara.FieldAttribute.Id == FieldAttributeEnum.BindField.Id)
                    {
                        item.CalculateResult = _BindItemValueCollection.GetBindItemValue(item.AccountSetPara.BindItem);
                    }
                }
                //todo 双薪
                //_AccountSet.CalculateItemList(_GetTax.GetIndividualIncomeTax(),null,1);
                _AccountSet.CalculateItemList(_GetTax.GetIndividualIncomeTax(), MakeEmployeeLastYearSalary(_EmployeeID), new HrmisUtility().EndMonthByYearMonth(_SalaryTime).Month);
            }
            salaryHistory.Description          = _Description;
            salaryHistory.SalaryDateTime       = _SalaryTime;
            salaryHistory.EmployeeSalaryStatus = EmployeeSalaryStatusEnum.TemporarySave;
            salaryHistory.AccountsBackName     = _BackAccountsName;
            salaryHistory.VersionNumber        = _VersionNum;
            return(salaryHistory);
        }
Beispiel #2
0
        private void ExportNormalInfo(int i, DataRow dr)
        {
            dr[0] = _AssessActivityList[i].ItsEmployee.Account.Name;
            if (_AssessActivityList[i].ItsEmployee.Account.Position.Grade != null)
            {
                dr[1] = _AssessActivityList[i].ItsEmployee.Account.Position.Grade.Name;
            }
            dr[2] = _AssessActivityList[i].ItsEmployee.EmployeeDetails.Work.ComeDate;
            dr[3] =
                _AssessActivityList[i].ItsEmployee.EmployeeDetails.Education.EducationalBackground.Name;
            dr[4] = _AssessActivityList[i].ItsEmployee.Account.Dept.DepartmentName;
            BindItemValueCollection collection =
                _GetBindField.BindItemValueCollection(_AssessActivityList[i].ItsEmployee.Account.Id,
                                                      _AssessActivityList[i].ScopeFrom, _AssessActivityList[i].ScopeTo);

            foreach (BindItemValue item in collection.BindItemValueList)
            {
                if (item.BindItemEnum.Id == BindItemEnum.OutCityDays.Id)
                {
                    dr[9] = item.Value;
                }
                else if (item.BindItemEnum.Id == BindItemEnum.Absenteeism.Id)
                {
                    dr[10] = item.Value;
                }
            }
        }
Beispiel #3
0
        public void Init(string id, bool isPostBack)
        {
            int _ID;

            if (!int.TryParse(id, out _ID))
            {
                _ItsView.Message = _InitialWrong;
                return;
            }
            _ItsView.TrainApplicationID = id;
            if (!isPostBack)
            {
                TraineeApplication traineeApplication = _ITrainFacade.GetTraineeApplicationByPkid(_ID);
                _ItsView.ScopeSource = TrainScopeType.AllTrainScopeTypes;
                if (traineeApplication == null)
                {
                    _ItsView.Message = _InitialWrong;
                    return;
                }
                _ItsView.EmployeeList = traineeApplication.StudentList;
                string _ChoosedEmployees = "";
                foreach (Account account in traineeApplication.StudentList)
                {
                    _ChoosedEmployees = _ChoosedEmployees + account.Name + ",";
                }
                _ItsView.ChoosedEmployees = _ChoosedEmployees;
                _ItsView.Cost             = traineeApplication.TrainCost.ToString();
                _ItsView.EduSpuCost       = traineeApplication.EduSpuCost == null
                                          ? ""
                                          : traineeApplication.EduSpuCost.ToString();
                _ItsView.CourseName = traineeApplication.CourseName;

                _ItsView.EndTime         = traineeApplication.EndTime.ToShortDateString();
                _ItsView.HasCertifaction = traineeApplication.HasCertifacation;
                _ItsView.Hour            = traineeApplication.TrainHour.ToString();

                _ItsView.Place     = traineeApplication.TrainPlace;
                _ItsView.Skills    = traineeApplication.Skills;
                _ItsView.StartTime = traineeApplication.StratTime.ToShortDateString();

                _ItsView.Trainer    = traineeApplication.Trainer;
                _ItsView.TrainScope = traineeApplication.TrainType.Id.ToString();
                _ItsView.Orgnation  = traineeApplication.TrainOrgnatiaon;
                if (_ItsView.OperationType == DetailOperationType)
                {
                    _ItsView.SetEnable = false;
                }
                else if (_ItsView.OperationType == ApproveOperationType)
                {
                    _ItsView.SetEnable  = false;
                    _ItsView.SetApprove = true;
                    try
                    {
                        BindItemValueCollection BindItemValueCollection =
                            _IGetBindFieldFacade.GetEmployeePassMonthBindField(traineeApplication.Applicant.Id,
                                                                               DateTime.Now.AddYears(1));
                        decimal month = BindItemValueCollection.GetBindItemValue(
                            BindItemEnum.LastYearProbationPassMonth);
                        _ItsView.ApplierInfo = traineeApplication.Applicant.Name + "; 今年年年底满试用期月份" +
                                               month + "个月";
                    }
                    catch
                    {
                        _ItsView.ApplierInfo = "数据确实,无法获取申请人信息。";
                    }
                }
                else
                {
                    _ItsView.SetEnable = true;
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public GetBindField()
 {
     _BindItemValueCollection = new BindItemValueCollection();
     _BindItemValueCollection.CreateAllBindItemsExceptNull();
 }
Beispiel #5
0
        /// <summary>
        ///
        /// </summary>
        public decimal Calculate(int accountid, DateTime start, DateTime end, string formula)
        {
            GetBindField            getBindField       = new GetBindField();
            BindItemValueCollection collection         = getBindField.BindItemValueCollection(accountid, start, end);
            List <ExpressionItem>   expressionItemList = new List <ExpressionItem>();

            expressionItemList.Add(new ExpressionItem(AssessBindItemEnum.ImposibleID, formula, EnumDataType.Number));
            foreach (BindItemValue item in collection.BindItemValueList)
            {
                if (item.BindItemEnum.Id == BindItemEnum.ShiJia.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.ShiJia.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.BingJia.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.BingJia.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.ChanQianJia.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.ChanQianJia.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.BuRuJia.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.BuRuJia.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.ChanJia.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.ChanJia.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.BeLate.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.BeLate.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.LeaveEarly.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.LeaveEarly.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.Absenteeism.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.Absenteeism.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.WorkAge.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.WorkAge.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.OnDutyDays.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.OnDutyDays.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.ExpectedOnDutyDays.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.ExpectOnDutyDays.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.PuTongOverTime.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.PuTongOverTime.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.ShuangXiuOverTime.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.ShuangXiuOverTime.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.JieRiOverTime.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.JieRiOverTime.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                else if (item.BindItemEnum.Id == BindItemEnum.OutCityDays.Id)
                {
                    expressionItemList.Add(
                        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.OutCityDays.ID), item.Value.ToString(),
                                           EnumDataType.Number));
                }
                //else if (item.BindItemEnum.Id == BindItemEnum.NotEntryDays.Id)
                //{
                //    expressionItemList.Add(
                //        new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.NotEntryDays.ID), item.Value.ToString(),
                //                           EnumDataType.Number));
                //}
                //else if (item.BindItemEnum.Id == BindItemEnum.DimissionDays.Id)
                //{
                //    expressionItemList.Add(
                //       new ExpressionItem(string.Format("A{0}", AssessBindItemEnum.DimissionDays.ID), item.Value.ToString(),
                //                          EnumDataType.Number));
                //}
            }
            CalculateExpressionItemList cal = new CalculateExpressionItemList(expressionItemList, "A");

            cal.CalculateExpressionResult();
            foreach (ExpressionItem item in expressionItemList)
            {
                if (item.Parameter == AssessBindItemEnum.ImposibleID)
                {
                    return(Convert.ToDecimal(item.Result));
                }
            }
            return(0);
        }