public ActionResult PromptNext(AuditPromptViewModel model) { var packageService = GetPackageService(); model.StandardPackageTypes = packageService.GetAllStandardPackageTypes(); if (model.SelectedPackages == null) { model.SelectedPackages = new List <SelectedPackage>(); } if (ModelState.IsValid) { var currentLocation = GetCurrentEmployee().Location; var packageType = model.StandardPackageTypes.FirstOrDefault(t => t.PackageTypeId == model.StandardPackageTypeId); List <string> barCodeList = model.SelectedPackages.Select(p => p.BarCode).ToList(); var reportService = GetReportService(); var reconciledPackages = reportService.GetReconciledPackages(currentLocation, packageType, barCodeList); TempData["AuditModel"] = model; return(View("Display", reconciledPackages)); } else { return(View("Prompt", model)); } }
public ActionResult Prompt() { var model = new AuditPromptViewModel(); model.SelectedPackages = new List <SelectedPackage>(); var packageService = GetPackageService(); model.StandardPackageTypes = packageService.GetAllStandardPackageTypes(); return(View(model)); }
public ActionResult PromptRemove(AuditPromptViewModel model) { var packageService = GetPackageService(); model.StandardPackageTypes = packageService.GetAllStandardPackageTypes(); var operations = new AuditSelectedBarCodesOperations(); string buttonValue = HttpContext.Request["action"]; operations.Remove(model, buttonValue); return(View("Prompt", model)); }
public ActionResult AuditChangePackageType(AuditPromptViewModel model) { var packageService = GetPackageService(); model.StandardPackageTypes = packageService.GetAllStandardPackageTypes(); if (model.SelectedPackages == null) { model.SelectedPackages = new List <SelectedPackage>(); } model.SelectedPackages.Clear(); return(View("Prompt", model)); }
public ActionResult PromptAdd(AuditPromptViewModel model) { var packageService = GetPackageService(); model.StandardPackageTypes = packageService.GetAllStandardPackageTypes(); var operations = new AuditSelectedBarCodesOperations(); operations.StandardPackageTypeId = model.StandardPackageTypeId; var result = operations.Add(model); if (!result.Succeeded) { ModelState.AddModelError("", result.ErrorMessage); } return(View("Prompt", model)); }
public ActionResult PromptClose(AuditPromptViewModel model) { return(RedirectToAction("Index", "Home")); }