public ViewResult PullDisplay(int pullHdrId) // ---------------------------------------------- { // created a PullDisplayViewModel to send in a PullHdr and CIKVP dictionary PullHdr localPull = pullRepo.PullHdrs.FirstOrDefault(p => p.PullHdrId == pullHdrId); var req = Request.Form["PullHdrId"]; var status = Request.Form["Status"]; PullDisplayViewModel PDVM = new PullDisplayViewModel(localPull, CIKVP); return(View(PDVM)); } // eo PullDisplay action method -----------------------------------------------------------
public IActionResult PullHdrChanged(PullHdr phdr) // ------------------------------------ { if (phdr != null) { // SavePullHdr method is member of EFPullHdrRepository.cs pullRepo.SavePullHdr(phdr); } //return RedirectToAction(nameof(Pull.Controllers.PullHdrController.PullMenu)); //RedirectToAction(string actionName, string controllerName); return(RedirectToAction("PullMenu", "PullHdr")); } // eo PullHdrChanged action -------------------------------------------------------------
public IActionResult PullHdrForm(PullHdr pull) // -------------------------------------------- { if (cart.Lines.Count() == 0) { ModelState.AddModelError("", "Sorry, the cart is empty"); } if (ModelState.IsValid) { foreach (CartLine line in cart.Lines) { // convert CartLine to PullItem in PullItem constructor pull.PullItems.Add(new PullItem(line)); } repository.SavePullHdr(pull); return RedirectToAction(nameof(CartCompleted)); } else { // need to decide where to go ? return View(); } } // eo PullHdrForm post version ----------------------------------------------------------