Exemple #1
0
        public List <WCF_DisbursementList> GetDisbursementList(string token)
        {
            //Check if user is authorizated to use this method. If is not authorized, it will return a json with -1 in the primary key
            if (!IsAuthanticateUser(token))
            {
                List <WCF_DisbursementList> wcf_UnAuthObj = new List <WCF_DisbursementList>();
                WCF_DisbursementList        wcfUnAuth     = new WCF_DisbursementList();
                wcfUnAuth.DisbursementID = -1;
                wcf_UnAuthObj.Add(wcfUnAuth);
                return(wcf_UnAuthObj);
            }

            List <DisbursementList>     dlist     = DisbursementLogic.GetDisbursementList();
            List <WCF_DisbursementList> wcf_Dlist = new List <WCF_DisbursementList>();

            foreach (DisbursementList d in dlist)
            {
                WCF_DisbursementList wcfD = new WCF_DisbursementList();
                wcfD.DisbursementID             = d.DisbursementID;
                wcfD.DepartmentID               = d.DepartmentID;
                wcfD.CollectionPointID          = d.CollectionPointID;
                wcfD.CollectionDate             = ((DateTime)d.CollectionDate).ToString("d");
                wcfD.RepresentativeName         = d.RepresentativeName;
                wcfD.Status                     = d.Status;
                wcfD.WCF_DisbursementListDetail = GetDisbursementListDetails(d.DisbursementID, internalSecertKey);
                wcf_Dlist.Add(wcfD);
            }
            return(wcf_Dlist);
        }
Exemple #2
0
        public void UpdateDisbursementStatus(WCF_DisbursementList disbursementList, string token)
        {
            //Check if user is authorizated to use this method. If is not authorized, it will return a json with -1 in the primary key
            if (!IsAuthanticateUser(token))
            {
                return;
            }
            DisbursementLogic.UpdateDisbursementStatus(disbursementList.DisbursementID, disbursementList.Status);
            DisbursementLogic dl = new DisbursementLogic();

            foreach (WCF_DisbursementListDetail d in disbursementList.WCF_DisbursementListDetail)
            {
                dl.UpdateDisbursementListDetails(d.ID, d.QuantityCollected, d.Remarks);
            }
        }