Ejemplo n.º 1
0
        public ActionResult Store(int?requestId)
        {
            if (requestId == null)
            {
                var li = Session["cartItems"] as List <string>;
                if (li == null)
                {
                    return(View("~/Views/Shared/Error.cshtml"));
                }
                var details = new List <RequestViewModel>();
                foreach (var itemNo in li)
                {
                    var detail = RequestDAO.CreateRequestViewModelByItemNumber(itemNo);
                    details.Add(detail);
                }

                // Pass data from controller to controller
                TempData["ViewModelInfo"] = details;
            }

            return(RedirectToAction("DepartmentCart", "Request", new { requestId = requestId }));
        }