public virtual ActionResult UpdateStyleSkuCase(StyleSkuCaseEditorViewModel model) { //TC5: If required feild does not passed. if (!ModelState.IsValid) { ModelState.AddModelError("", "Required fields must be passed"); //return RedirectToAction(Actions.SkuCase()); return(RedirectToAction(Actions.StyleSkuCase())); } try { _service.Value.InsertPackingRule(new StyleSkuCase { CaseId = model.CaseId, IgnoreFlag = model.IgnoreFlag, Style = model.Style }); this.AddStatusMessage(string.Format("Packing rule is added for case {0} against style {1}", model.CaseId, model.Style)); } catch (Exception ex) { ModelState.AddModelError("", ex.InnerException); } //return RedirectToAction(Actions.SkuCase()); return(RedirectToAction(Actions.StyleSkuCase())); }
public virtual ActionResult StyleSkuCaseEditor(string style, string caseId, bool?ignoreFlag) { var skuCaseList = _service.Value.GetSkuCaseList(); var model = new StyleSkuCaseEditorViewModel { SkuCaseList = skuCaseList.Select(Map), Style = style, CaseId = caseId, IgnoreFlag = ignoreFlag.HasValue }; return(PartialView(Views._styleSkuCaseEditorPartial, model)); }