Beispiel #1
0
        private double HandleIt(vw_employment currentStaff, tprsalhi salHis, string vtyp, double valu, string cccd, 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 (cccd != string.Empty)
            {
                tprcstalc cstalc = new tprcstalc();
                cstalc.cccd = cccd;
                cstalc.amnt = resultValue;
                cstalc.emno = currentStaff.emno;
                cstalc.itcd = salHis.itcd;
                cstalc.perd = salHis.perd;
                cstalc.pkty = salHis.pkty;
                cstalc.rnno = salHis.rnno;
                cstalc.sqno = sqno;
                cstalc.crcd = salHis.crcd;
                cstalc.sqno = salHis.sqno;
                cstalc.pdcd = salHis.pdcd;

                DoInsert <tprcstalc>(cstalc);
            }

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

                DoInsert <tprcstalc>(cstalc);
            }
        }