public ActionResult ApproveDisbursement() { OutstandingDAO outstandingDAO = new OutstandingDAO(); string deptId = GetDeptId(Session["username"].ToString()); //foreach(var ir in itemRequestDAO.GetDisburseItems(deptId)) //{ // outstandingDAO.AddItemRequest(ir); // requestDAO.UpdateDisbursedDate(ir); //} DisbursementDAO dao = new DisbursementDAO(); dao.ApproveDisbursement(deptId); return(RedirectToAction("Disbursement")); }
public ActionResult Index() { RequestDAO r = new RequestDAO(); ItemDAO i = new ItemDAO(); OutstandingDAO o = new OutstandingDAO(); List <Item> ItemIdsAndThresholdValue = i.GetItemIdsAndThresholdValue(); int low = 0; foreach (var row in ItemIdsAndThresholdValue) { if (row.ThresholdValue > i.GetBalanceByItemId(row.Id)) { low++; } } ViewData["todayCount"] = r.getTodayReqCount(); ViewData["lowstock"] = low; ViewData["outCount"] = o.GetPendingOutstandingCount(); return(View()); }