public static IDisburseId Make(int disbursementId, string disbursementStatus)
    {
        IDisburseId dId = new IDisburseId();

        dId.disbursementId     = disbursementId;
        dId.disbursementStatus = disbursementStatus;


        return(dId);
    }
Example #2
0
    public bool UpdateDisbursementStatus(IDisburseId disburseId)
    {
        string deptName = udlc.getDeptName(disburseId.DisbursementId);

        int result = udlc.updateDisbursementStatusMobile(disburseId.DisbursementId, disburseId.DisbursementStatus);

        if (disburseId.DisbursementStatus == cancelDisbursement)
        {
            udlc.createRequest(deptName);

            List <StationeryDisbursementDetail> list = udlc.getStationeryDisbursementDetail(disburseId.DisbursementId);


            foreach (StationeryDisbursementDetail sdd in list)
            {
                udlc.createRequestDetails(udlc.getRequestID(), sdd.ItemCode, (int)sdd.RequestedQty);
            }
        }
        else if (disburseId.DisbursementStatus == partialDisbursement)
        {
            udlc.createRequest(deptName);

            List <StationeryDisbursementDetail> list = udlc.getStationeryDisbursementDetail(disburseId.DisbursementId);

            foreach (StationeryDisbursementDetail sdd in list)
            {
                int shortfall = (int)sdd.RequestedQty - (int)sdd.ActualQty;

                if (shortfall > 0)
                {
                    udlc.createRequestDetails(udlc.getRequestID(), sdd.ItemCode, shortfall);
                }
            }
        }

        return(result > 0);
    }