Esempio n. 1
0
        public ActionResult ApprovedRequisitions([DataSourceRequest] DataSourceRequest request)

        {
            ViewBag.Months = new SelectList(RequestHelper.GetMonthList(), "Id", "Name");
            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 requisititions       = _reliefRequisitionService.FindBy(r => r.Status == (int)ReliefRequisitionStatus.Approved);
            var requisitionViewModel = HubAllocationViewModelBinder.ReturnRequisitionGroupByReuisitionNo(requisititions);

            if (requisitionViewModel != null)
            {
                var total = requisitionViewModel.Count();
                ViewData["total"] = total;
            }
            else
            {
                return(HttpNotFound());
            }
            //.re _reliefRequisitionDetailService.Get(r => r.ReliefRequisition.Status == 2, null, "ReliefRequisition,Donor");
            return(View(requisitionViewModel.ToList()));
        }
        public JsonResult ReadRequisitions(int regionId)
        {
            var requisititions       = _reliefRequisitionService.FindBy(r => r.Status == (int)ReliefRequisitionStatus.Approved && r.RegionID == regionId);
            var requisitionViewModel = HubAllocationViewModelBinder.ReturnRequisitionGroupByReuisitionNo(requisititions);

            return(Json(requisitionViewModel, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AllocateProjectCode()
        {
            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 requisititions       = _requisitionService.FindBy(r => r.Status == (int)ReliefRequisitionStatus.HubAssigned);
            var requisitionViewModel = HubAllocationViewModelBinder.ReturnRequisitionGroupByReuisitionNo(requisititions);


            if (requisitionViewModel != null)
            {
                var total = requisitionViewModel.Count();
                ViewData["total"] = total;
            }
            else
            {
                return(HttpNotFound());
            }

            return(View(requisitionViewModel.ToList()));
        }
        public ActionResult AllocateProjectCode([DataSourceRequest] DataSourceRequest request, int regionId, int status)
        {
            ViewBag.requestStatus = status;
            List <ReliefRequisition> requisititions = null;

            if (regionId == -1 || status == -1)
            {
                return(Json((new List <RequisitionViewModel>()).ToDataSourceResult(request)));
            }
            requisititions = _reliefRequisitionService.FindBy(
                r =>
                r.Status == status && r.RegionID == regionId).OrderByDescending(t => t.RequisitionID).ToList();


            var requisitionViewModel = HubAllocationViewModelBinder.ReturnRequisitionGroupByReuisitionNo(requisititions);

            return(Json(requisitionViewModel.ToDataSourceResult(request)));
        }