public ActionResult Edit(ProductType ProductType) { if (ModelState.IsValid) { this.genericMgr.UpdateWithTrim(ProductType); SaveSuccessMessage(Resources.MRP.ProductType.ProductType_Updated); } return View(ProductType); }
public ActionResult _ProductTypeDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, bool? enable) { ViewBag.ControlName = controlName; ViewBag.ControlId = controlId; //ViewBag.SelectedValue = selectedValue; ViewBag.Enable = enable; IList<ProductType> productTypeCategoryList = null; productTypeCategoryList = queryMgr.FindAll<ProductType>("from ProductType as i"); if (includeBlankOption.HasValue && includeBlankOption.Value) { ProductType blankproductTypeCategory = new ProductType(); blankproductTypeCategory.Code = blankOptionValue; blankproductTypeCategory.Description = blankOptionDescription; productTypeCategoryList.Insert(0, blankproductTypeCategory); } return PartialView(new SelectList(productTypeCategoryList.OrderBy(p => p.Code), "Code", "CodeDescription", selectedValue)); }
public ActionResult New(ProductType ProductType) { if (ModelState.IsValid) { if (this.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { ProductType.Code })[0] > 0) { SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, ProductType.Code); } else { this.genericMgr.CreateWithTrim(ProductType); SaveSuccessMessage(Resources.MRP.ProductType.ProductType_Added); return RedirectToAction("Edit/" + ProductType.Code); } } return View(ProductType); }