public ActionResult _LocationBinDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue) { ViewBag.ControlName = controlName; ViewBag.ControlId = controlId; //ViewBag.SelectedValue = selectedValue; IList<LocationBin> locationBinList = base.genericMgr.FindAll<LocationBin>("from LocationBin as l where l.IsActive = ?", true); if (locationBinList == null) { locationBinList = new List<LocationBin>(); } if (includeBlankOption.HasValue && includeBlankOption.Value) { LocationBin blankItem = new LocationBin(); blankItem.Code = blankOptionValue; blankItem.Name = blankOptionDescription; locationBinList.Insert(0, blankItem); } return PartialView(new SelectList(locationBinList, "Code", "Name", selectedValue)); }
public ActionResult _AjaxLoadingLocationBin(string party, string RegionValue) { IList<LocationBin> locationBinList = new List<LocationBin>(); if (party == null) { locationBinList = base.genericMgr.FindAll<LocationBin>("from locationBin l where l.Region is null and l.IsActive=?", true, firstRow, maxRow); } else { locationBinList = base.genericMgr.FindAll<LocationBin>("from locationBin l where l.Region=? and l.IsActive=?", new object[] { party, true }, firstRow, maxRow); } LocationBin blankLocation = new LocationBin(); blankLocation.Code = string.Empty; blankLocation.Name = string.Empty; locationBinList.Insert(0, blankLocation); if (string.IsNullOrEmpty(RegionValue)) { return new JsonResult { Data = new SelectList(locationBinList, "Code", "CodeName", "") }; } else { return new JsonResult { Data = new SelectList(locationBinList, "Code", "Name", RegionValue) }; } }
public ActionResult _LocationBinNew(LocationBin locationBin, string locationCode) { locationBin.Location = locationCode; ViewBag.LocationCode = locationCode; if (ModelState.IsValid) { if (base.genericMgr.FindAll<long>(locationBinDuiplicateVerifyStatement, new object[] { locationBin.Code })[0] > 0) { SaveErrorMessage(Resources.ErrorMessage.Errors_Existing_Code, locationBin.Code); } else { base.genericMgr.Create(locationBin); SaveSuccessMessage(Resources.MD.LocationBin.LocationBin_Added); return RedirectToAction("_LocationBinEdit/" + locationBin.Code); } } return PartialView(locationBin); }
public ActionResult _LocationBinEdit(LocationBin locationBin) { if (ModelState.IsValid) { base.genericMgr.Update(locationBin); SaveSuccessMessage(Resources.MD.LocationBin.LocationBin_Updated); } return PartialView(locationBin); }
public ActionResult _LocationBinNew(LocationBin locationBin, string locationCode) { locationBin.Location = locationCode; ViewBag.LocationCode = locationCode; if (ModelState.IsValid) { if (this.genericMgr.FindAll<long>(locationBinDuiplicateVerifyStatement, new object[] { locationBin.Code })[0] > 0) { SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, locationBin.Code); } else { this.genericMgr.CreateWithTrim(locationBin); SaveSuccessMessage(Resources.MD.LocationBin.LocationBin_Added); return new RedirectToRouteResult(new RouteValueDictionary { { "action", "_LocationBinList" }, { "controller", "Location" }, { "LocationCode", locationCode } }); } } return PartialView(locationBin); }