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 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")); }