Пример #1
0
        public object GetValue(PrCalculationStore store)
        {
            try
            {
                double result = 0;
                for (int i = 0; i < store.ParametersForValue.Count; i++)
                {
                    var    ltcd  = store.ParametersForValue[i].ToString().Replace("\"", "");
                    var    q     = store.lstLeaveDetails.Where(p => p.ltcd == store.ParametersForValue[i].ToString() && p.emno == store.CurrentEmployment.emno).Select(p => p.hurs).Sum();
                    double limit = GetLimit(store, store.ParametersForValue[i].ToString());

                    result += (q <= limit ? q : limit);
                }

                if (store.ParametersForValue.Count == 0)
                {
                    var    q     = store.lstLeaveDetails.Where(p => p.emno == store.CurrentEmployment.emno).Select(p => p.hurs).Sum();
                    double limit = GetLimit(store, "All");
                    result = (q <= limit ? q : limit);
                }

                return(result);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Пример #2
0
        public object GetValue(PrCalculationStore store)
        {
            try
            {
                double result = 0;

                for (int i = 0; i < store.ParametersForValue.Count; i++)
                {
                    var ltcd = store.ParametersForValue[i].ToString().Replace("\"", "");
                    var q    = store.lstLeaveDetails.Where(p => p.ltcd == ltcd && p.emno.Trim() == store.CurrentEmployment.emno).Select(p => p.days).Sum();
                    result += q;
                }

                if (store.ParametersForValue.Count == 0)
                {
                    var q = store.lstLeaveDetails.Where(p => p.emno == store.CurrentEmployment.emno).Select(p => p.days).Sum();
                    result = q;
                }

                return(result);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Пример #3
0
        public object GetValue(PrCalculationStore store)
        {
            double result = 0;

            result = Convert.ToDouble((store.PeriodEnd - store.PeriodStart).TotalDays + 1);
            return(result);
        }
Пример #4
0
        public object GetValue(PrCalculationStore store)
        {
            try
            {
                //用户变量,则直接抓去值
                object valu = null;
                string vari = this.GetType().Name;

                var q = store.lstVariables.Where(p => p.vacd == vari).ToList();

                if (q.Count > 0)
                {
                    tprvarble mdl = q.First();
                    valu = double.Parse(mdl.vlva);
                }
                else
                {
                    valu = 0;
                }

                return(valu);
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }
Пример #5
0
        public double GetLimit(PrCalculationStore store, string _ltcd)
        {
            lvlealmtDal limitDal   = new lvlealmtDal();
            double      monthLimit = limitDal.GetMonthlmbyEmp(store.CurrentEmployment, _ltcd, HRMS_Limit_Type.LeaveHours);

            if (monthLimit == null)
            {
                monthLimit = 1000;
            }
            if ((monthLimit == -1) || (monthLimit < 0))
            {
                monthLimit = 10000;
            }

            return(monthLimit);
        }
Пример #6
0
        public object GetValue(PrCalculationStore store)
        {
            try
            {
                double result = 0;

                var q = store.lstAbsenceDetails.Where(p => p.emno == store.CurrentEmployment.emno).Select(p => p.ahrs).Sum();
                result += q.HasValue ? q.Value : 0;

                return(result);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Пример #7
0
        public object GetValue(PrCalculationStore store)
        {
            double d = store.CurrentEmployment.dayservice.HasValue ? store.CurrentEmployment.dayservice.Value : 0;

            if (d == null)
            {
                d = 0;
            }

            if (d < 0)
            {
                d = 0;
            }

            return(d);
        }
Пример #8
0
        public object GetValue(PrCalculationStore store)
        {
            bool result = false;

            if (!store.CurrentEmployment.prdt.HasValue)
            {
                result = false;
            }

            //判断加入日期和期末是否在同一个月,如果在,则认为true,否则则为false
            if (store.CurrentEmployment.prdt.Value.Month == store.PeriodEnd.Month)
            {
                result = true;
            }
            else
            {
                result = false;
            }

            return(result);
        }
Пример #9
0
        public object GetValue(PrCalculationStore store)
        {
            bool result = false;

            if (store.CurrentEmployment.tmdt.HasValue)
            {
                if (store.CurrentEmployment.tmdt > store.PeriodEnd)
                {
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            else
            {
                result = false;
            }

            return(result);
        }
Пример #10
0
 public object GetValue(PrCalculationStore store)
 {
     return(store.PeriodEnd);;
 }
Пример #11
0
 public object GetValue(PrCalculationStore store)
 {
     return(0);
 }
Пример #12
0
 public object GetValue(PrCalculationStore store)
 {
     return(store.CurrentEmployment.age.HasValue ? store.CurrentEmployment.age.Value : 0);
 }
Пример #13
0
 public object GetValue(PrCalculationStore store)
 {
     //需要考虑本月新入职员工/和本月离职员工
     return(0);
 }
Пример #14
0
 public object GetValue(PrCalculationStore store)
 {
     store.ParametersForValue.Add(store.CurrentExpressionRight);
     return(store.CurrentExpressionRight.Replace("\"", ""));
 }
Пример #15
0
 public object GetValue(PrCalculationStore store)
 {
     return(new DateTime(store.PeriodStart.Year, store.PeriodStart.Month, 1).AddMonths(1).AddDays(-1));
 }
Пример #16
0
 public object GetValue(PrCalculationStore store)
 {
     return(store.CurrentExpressionRight.Replace("\"", ""));
 }