Ejemplo n.º 1
0
        public FreeSIPC getSIPCLists(int reqId, int CommodityID)
        {
            var hubId = _hubAllocationService.GetAllocatedHubId(reqId);

            List <LedgerService.AvailableShippingCodes> freeSICodes = _ledgerService.GetFreeSICodesByCommodity(hubId, CommodityID);
            List <LedgerService.AvailableProjectCodes>  freePCCodes = _ledgerService.GetFreePCCodesByCommodity(hubId, CommodityID);
            FreeSIPC free = new FreeSIPC {
                FreePCCodes = freePCCodes, FreeSICodes = freeSICodes
            };

            return(free);
        }
Ejemplo n.º 2
0
        public ActionResult Assign(int reqId, double remaining, double totalAssigned)
        {
            var previousModelState = TempData["ModelState"] as ModelStateDictionary;

            if (previousModelState != null)
            {
                foreach (KeyValuePair <string, ModelState> kvp in previousModelState)
                {
                    if (!ModelState.ContainsKey(kvp.Key))
                    {
                        ModelState.Add(kvp.Key, kvp.Value);
                    }
                }
            }

            var hubId = _hubAllocationService.GetAllocatedHubId(reqId);
            ReliefRequisition listOfRequsitions = _requisitionService.Get(r => r.RequisitionID == reqId).SingleOrDefault();

            List <LedgerService.AvailableShippingCodes> freeSICodes = _ledgerService.GetFreeSICodesByCommodity(hubId, (int)listOfRequsitions.CommodityID);
            List <LedgerService.AvailableProjectCodes>  freePCCodes = _ledgerService.GetFreePCCodesByCommodity(hubId, (int)listOfRequsitions.CommodityID);

            ViewBag.FreeSICodes = freeSICodes;
            ViewBag.FreePCCodes = freePCCodes;
            ViewBag.SI          = new SelectList(freeSICodes, "siCodeId", "SIcode");
            ViewBag.PC          = new SelectList(freePCCodes, "pcCodeId", "PCcode");



            // ViewBag.SI = new SelectList(_shippingInstructionService.GetAllShippingInstruction(), "ShippingInstructionID", "Value");
            ViewBag.Total = totalAssigned;
            //ViewBag.PC = new SelectList(_projectCodeService.GetAllProjectCode(), "ProjectCodeID", "Value");
            ViewBag.RequetedAmount = Math.Round(listOfRequsitions.ReliefRequisitionDetails.Sum(a => a.Amount));
            ViewBag.Hub            = _hubAllocationService.GetAllocatedHub(reqId);
            ViewBag.ReqId          = listOfRequsitions.RequisitionID;
            ViewBag.Remaining      = Math.Round(remaining);
            return(View());
        }