public void updateRequisitionDelivery(DisbursementHelper disbursementHelper, string itemId)
        {
            try
            {
                ctx.updateRequisitionDeliveryPro(disbursementHelper.RequisitionId, itemId, disbursementHelper.DeliveredQty);

                //requisitionDetail reqD = (from r in ctx.requisitionDetails
                //                          where r.itemId == itemId && r.requisitionId == disbursementHelper.RequisitionId
                //                          select r).FirstOrDefault();

                //reqD.deliveredQty = disbursementHelper.DeliveredQty;

                //ctx.SaveChanges();
            }
            catch (Exception exception)
            {
                errorobj.WriteErrorLog("RequisitionFacade-updateRequisitionDelivery():::" + exception.ToString());
            }
        }
        public List<DisbursementHelper> getRequisitionsForDisbursement(string itemId)
        {
            List<DisbursementHelper> disbursementHelperCollection = new List<DisbursementHelper>();
            try
            {
                var reqC = from rD in ctx.requisitionDetails
                           where
                             (new string[] { "Approved", "Outstanding","In Progress" }).Contains(rD.requisition.status) &&
                             rD.itemId == itemId &&
                             rD.requestedQty != rD.deliveredQty
                           group new { rD.requisition, rD } by new
                           {
                               rD.requisition.requisitionId,
                               Date = (DateTime?)rD.requisition.date,
                               rD.requisition.departmentId,
                               rD.requisition.status,
                               Column1 = (rD.requestedQty - rD.deliveredQty)
                           } into g
                           orderby
                             g.Key.Date ascending
                           select new
                           {
                               reqId = g.Key.requisitionId,
                               depId = g.Key.departmentId,
                               status = g.Key.status,
                               reqQ = g.Key.Column1
                           };

                foreach(var r in reqC)
                {
                    DisbursementHelper disbursementHelper = new DisbursementHelper();
                    disbursementHelper.RequisitionId = r.reqId;
                    disbursementHelper.DepartmentId = r.depId;
                    disbursementHelper.Status = r.status;
                    disbursementHelper.RequestedQty = Convert.ToInt32(r.reqQ);

                    disbursementHelperCollection.Add(disbursementHelper);
                }

            }
            catch (Exception exception)
            {
                errorobj.WriteErrorLog("RequisitionFacade-getRequisitionsForDisbursement():::" + exception.ToString());
                disbursementHelperCollection = new List<DisbursementHelper>();
            }

            return disbursementHelperCollection;
        }