public ActionResult New(Container container) { if (ModelState.IsValid) { if (this.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { container.Code })[0] > 0) { SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, container.Code); } else { this.genericMgr.CreateWithTrim(container); SaveSuccessMessage(Resources.MD.Container.Container_Added); return RedirectToAction("Edit/" + container.Code); } } return View(container); }
public ActionResult Edit(Container container) { if (ModelState.IsValid) { this.genericMgr.UpdateWithTrim(container); SaveSuccessMessage(Resources.MD.Container.Container_Updated); } return View(container); }
public ActionResult _ContainerDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue) { ViewBag.ControlName = controlName; ViewBag.ControlId = controlId; IList<Container> containerList = base.genericMgr.FindAll<Container>("from Container as c where c.IsActive=?", true); if (containerList == null) { containerList = new List<Container>(); } if (includeBlankOption.HasValue && includeBlankOption.Value) { Container blankContainer = new Container(); blankContainer.Code = blankOptionValue; blankContainer.Description = blankOptionDescription; containerList.Insert(0, blankContainer); } return PartialView(new SelectList(containerList, "Code", "Description", selectedValue)); }