示例#1
0
        private double HandleIt(vw_employment currentStaff, tprsalhi salHis, string vtyp, double valu, string acno, int sqno)
        {
            double resultValue = 0;
            double validValue  = 0;

            if (salHis.ajva.HasValue)
            {
                validValue = salHis.ajva.Value;
            }
            else
            {
                validValue = salHis.valu;
            }

            switch (vtyp)
            {
            case "Percentage":
                resultValue = ReturnValueByPercentage(validValue, valu);
                break;

            case "Value":
                resultValue = ReturnValueByValue(validValue, valu);
                break;

            default:
                resultValue = 0;
                break;
            }

            if (acno != string.Empty)
            {
                tpraccalc accalc = new tpraccalc();
                accalc.acno = acno;
                accalc.amnt = resultValue;
                accalc.emno = currentStaff.emno;
                accalc.itcd = salHis.itcd;
                accalc.perd = salHis.perd;
                accalc.pkty = salHis.pkty;
                accalc.rnno = salHis.rnno;
                accalc.sqno = sqno;
                accalc.crcd = salHis.crcd;
                accalc.pdcd = salHis.pdcd;

                DoInsert <tpraccalc>(accalc);
            }

            return(resultValue);
        }
示例#2
0
        private void HandleLeft(vw_employment currentStaff, tprsalhi salHis, double valu, string acno, int sqno)
        {
            if (acno != string.Empty)
            {
                tpraccalc accalc = new tpraccalc();
                accalc.acno = acno;
                accalc.amnt = valu;
                accalc.emno = currentStaff.emno;
                accalc.itcd = salHis.itcd;
                accalc.perd = salHis.perd;
                accalc.pkty = salHis.pkty;
                accalc.rnno = salHis.rnno;
                accalc.sqno = sqno;
                accalc.crcd = salHis.crcd;
                accalc.pdcd = salHis.pdcd;

                DoInsert <tpraccalc>(accalc);
            }
        }