Ejemplo n.º 1
0
        // GET: View retrieval list
        public ActionResult ViewRetrievalList()
        {
            int        retrievalListId    = reqService.FindCurrentRetrievalList().RetrievalListID;
            List <int> requisitionIDs     = db.RequisitionRetrievals.Where(r => r.RetrievalListID == retrievalListId).Select(r => r.RequisitionID).ToList();
            var        requisitionDetails = db.RequisitionDetails.Where(r => requisitionIDs.Contains(r.RequisitionID)).ToList();

            ViewData["requisitionDetails"] = requisitionDetails;
            Dictionary <Item, int> itemQuantity = reqService.GetItemAndQuantity(requisitionDetails);

            ViewData["itemquantity"] = itemQuantity;
            List <Item> items = itemQuantity.Keys.ToList();

            ViewData["items"]       = items;
            ViewBag.retrievalListId = retrievalListId;
            Dictionary <Item, Dictionary <Requisition, int> > itemRquisitionList = new Dictionary <Item, Dictionary <Requisition, int> >();

            foreach (var item in items)
            {
                if (!itemRquisitionList.ContainsKey(item))
                {
                    itemRquisitionList.Add(item, reqService.GetRequisitionByItem(item, requisitionDetails));
                }
            }
            ViewData["itemRequisitionList"] = itemRquisitionList;
            return(View("~/Views/Store/Clerk/ViewRetrievalList.cshtml", items));
        }
        //Author: Phung Khanh Chi
        public ActionResult Index()
        {
            List <Requisition> employeeRequisitions = repService.GetEmployeeRequisition()
                                                      .Take(PAGE_SIZE).ToList();
            int retrievalListId = reqService.FindCurrentRetrievalList().RetrievalListID - 1;
            List <RetrievalListDetail> disbursementList = repService.GetDisbursementList(retrievalListId);
            List <Requisition>         myRequisitions   = employeeService.GetRequisitions();

            ViewBag.empRequisitions  = employeeRequisitions;
            ViewBag.disbursementList = disbursementList;
            ViewBag.myRequisitions   = myRequisitions;
            return(View("~/Views/Department/Representative/Index.cshtml"));
        }