public override bool Equals(object obj) { Uom another = obj as Uom; if (another == null) { return(false); } else { return(this.Code == another.Code); } }
public ActionResult _UomDropDownList(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<Uom> uomList = base.genericMgr.FindAll<Uom>("from Uom as u order by u.Code desc"); if (uomList == null) { uomList = new List<Uom>(); } if (includeBlankOption.HasValue && includeBlankOption.Value) { Uom blankUom = new Uom(); blankUom.Code = blankOptionValue; blankUom.Description = blankOptionDescription; uomList.Insert(0, blankUom); } return PartialView(new SelectList(uomList, "Code", "Code", selectedValue)); }
public ActionResult _NewUomDropDownList(string item, 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; ViewBag.Item = item; IList<Uom> uomList = itemMgr.GetItemUoms(item); if (includeBlankOption.HasValue && includeBlankOption.Value) { Uom blankUom = new Uom(); blankUom.Code = blankOptionValue; blankUom.Description = blankOptionDescription; uomList.Insert(0, blankUom); } return PartialView(new SelectList(uomList, "Code", "Code", selectedValue)); }
public ActionResult _Edit(Uom uom) { try { base.genericMgr.Update(uom); SaveSuccessMessage(Resources.MD.Uom.Uom_Updated); return RedirectToAction("List"); } catch (BusinessException ex) { SaveBusinessExceptionMessage(ex); } catch (Exception ex) { SaveErrorMessage(ex); } return RedirectToAction("_Edit/" + uom.Code); }
public ActionResult New(Uom uom) { if (ModelState.IsValid) { if (base.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { uom.Code })[0] > 0) { SaveErrorMessage(Resources.ErrorMessage.Errors_Existing_Code, uom.Code); } else { base.genericMgr.Create(uom); SaveSuccessMessage(Resources.MD.Uom.Uom_Added); return RedirectToAction("_Edit/" + uom.Code); } } return PartialView(uom); }
public ActionResult _Edit(Uom uom) { if (ModelState.IsValid) { this.genericMgr.UpdateWithTrim(uom); SaveSuccessMessage(Resources.MD.Uom.Uom_Updated); return RedirectToAction("_Edit/" + uom.Code); } return PartialView(uom); }