Exemplo n.º 1
0
        // James: Disbursement overview
        public ActionResult Disbursement()
        {
            /*            if (Session["IdEmployee"] == null || (String)Session["Role"] != "StockClerk")
             *              return RedirectToAction("Login", "Home");*/

            int IdStoreClerk = 1;

            if (Session["IdEmployee"] != null)
            {
                IdStoreClerk = (int)Session["IdEmployee"];
            }



            // retrieve 2 lists of Disbursement Lists which are "Prepared" and "Scheduled" under the same Coll Point
            // find by Status and Clerk's Collection Points
            List <Disbursement> prepList = _disbursementDAO.FindByStatus("Prepared", IdStoreClerk);
            List <Disbursement> scheList = _disbursementDAO.FindByStatus("Scheduled", IdStoreClerk);

            scheList.AddRange(_disbursementDAO.FindByStatus("Received", IdStoreClerk));
            scheList.AddRange(_disbursementDAO.FindByStatus("Disbursed", IdStoreClerk));

            ViewBag.prepList = prepList;
            ViewBag.scheList = scheList;

            // Finds Next Monday
            DateTime NextMon = DateTime.Now;

            while (NextMon.DayOfWeek != DayOfWeek.Monday)
            {
                NextMon = NextMon.AddDays(1);
            }

            ViewBag.NextMon = NextMon.ToString("yyyy-MM-dd");

            return(View());
        }