예제 #1
0
        public override string GetLeftLeaveMessage()
        {
            Annual annual          = new Annual(mContext, mLeaver, 0);
            double annualLeaveDays = annual.getAlreadyLeaveDays();
            double carryDays       = annual.getLastYearCarryOverDays();
            double leaveDays       = getAlreadyLeaveDays();
            string leaveName       = getLeaveName();
            double leftDays        = 0;
            string msg             = "";

            if (IsKaiMan())
            {
                leftDays = mOnceAllowDays + carryDays - leaveDays - annualLeaveDays;
                msg      = string.Format("{0}, 目前剩余可请{1}天(含去年结转{2}天),已请{3}天,年休假已清{4}天,本年总可请(含结转){5}天,目前释放(含结转){6}天。\n",
                                         leaveName, leftDays, carryDays, leaveDays, annualLeaveDays, mYearAllowDays + carryDays, mOnceAllowDays + carryDays);
            }
            else
            {
                leftDays = mOnceAllowDays - leaveDays - annualLeaveDays;
                msg      = string.Format("{0}, 目前剩余可请{1}天,已请{2}天,年休假已清{3}天,本年总可请{4}天。\n",
                                         leaveName, leftDays, leaveDays, annualLeaveDays, mYearAllowDays);
            }

            return(msg);
        }
예제 #2
0
        public override bool ValidateLeave(ref string msg)
        {
            Annual annual          = new Annual(mContext, mLeaver, 0);
            double annualLeaveDays = annual.getAlreadyLeaveDays();
            double carryDays       = getLastYearCarryOverDays();
            double leaveDays       = getAlreadyLeaveDays();
            double leftDays        = IsKaiMan() ? mOnceAllowDays + carryDays - leaveDays - annualLeaveDays :
                                     mOnceAllowDays - leaveDays - annualLeaveDays;

            if (leftDays < mLeaveDays)
            {
                msg += string.Format("{0}的{1}提交失败, 原因:超出了目前可请假的天数{2}天。\n", getLeaver(), getLeaveName(), leftDays);
                return(false);
            }
            return(true);
        }
예제 #3
0
        public override ReportData GetReportData()
        {
            Annual annual          = new Annual(mContext, mLeaver, 0);
            double annualLeaveDays = annual.getAlreadyLeaveDays();
            double carryDays       = annual.getLastYearCarryOverDays();
            double leaveDays       = getAlreadyLeaveDays();

            return(new ReportData
            {
                Year = 0,
                LeaveType = (int)mLeaveType,
                Name = mLeaver,
                AllowDays = mYearAllowDays,
                LastYearLeft = carryDays,
                CurrDays = mOnceAllowDays,
                LeftDays = leaveDays + annualLeaveDays,
                SurplusDays = mYearAllowDays + carryDays - leaveDays - annualLeaveDays,
            });
        }