Exemplo n.º 1
0
        public ActionResult Restock(RestockViewModel rvm)
        {
            if (!_vm.Role.IsServiceman)
            {
                _vm.LogoutUser();
            }

            _vm.Restock(rvm.Qty);

            return(GetAuthenticatedView("Index"));
        }
Exemplo n.º 2
0
        // show Requests History view

        /// <summary>
        /// show all requests, both pending and approved
        /// </summary>
        /// <returns></returns>
        public ActionResult viewRequestsHistory()
        {
            if (Session == null || Session["type"] == null || !((string)Session["type"]).Equals("Employee"))
            {
                return(RedirectToAction("my404", "Home"));
            }
            else
            {
                int empID = (int)Session["userID"];
            }

            stockDal = new stockRequestDal();
            rvm      = new RestockViewModel();
            rvm.sr   = new StockRequest();

            //add: stock requests by empID
            rvm.stockRequestList = stockDal.stockRequests.ToList <StockRequest>();
            return(View(rvm));
        }