public ActionResult DeleteProductCategory(string categoryCode) { var result = false; string message = string.Empty; try { result = new NetStock.BusinessFactory.ProductCategoryBO().DeleteProductCategory(new NetStock.Contract.ProductCategory { CategoryCode = categoryCode }); TempData["isSaved"] = result; if (result) { @TempData["resultMessage"] = string.Format("Product Category [{0}] Deleted Successfully", categoryCode); } else { @TempData["resultMessage"] = "Unable to DELETE the Record!"; } } catch (Exception ex) { @TempData["isSaved"] = false; @TempData["resultMessage"] = string.Format("Error Occurred {0}", ex.Message.ToString()); ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("ProductCategoryList", "MasterData")); }
public ActionResult EditProductCategory(string categoryCode) { var productCategory = new NetStock.Contract.ProductCategory(); if (categoryCode != null && categoryCode.Length > 0) { productCategory = new NetStock.BusinessFactory.ProductCategoryBO().GetProductCategory(new ProductCategory { CategoryCode = categoryCode }); } return(PartialView("ProductCategory", productCategory)); }
public static IEnumerable <SelectListItem> GetProductCategory() { var lstLookUp = new NetStock.BusinessFactory.ProductCategoryBO().GetList(); if (lstLookUp == null) { return(null); } var selectList = lstLookUp.Select(c => new SelectListItem { Value = c.CategoryCode, Text = c.Description }); return(new SelectList(selectList, "Value", "Text")); }
public ActionResult SaveProductCategory(NetStock.Contract.ProductCategory productCategory) { try { if (productCategory == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } productCategory.CreatedBy = Session["DEFAULTUSER"].ToString(); productCategory.ModifiedBy = Session["DEFAULTUSER"].ToString(); var result = new NetStock.BusinessFactory.ProductCategoryBO().SaveProductCategory(productCategory); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); } return(RedirectToAction("ProductCategoryList")); }
public ActionResult ProductCategoryList() { var lstLookup = new NetStock.BusinessFactory.ProductCategoryBO().GetList(); return(View("ProductCategoryList", lstLookup)); }