public ActionResult ajaxAttribute(string id = "") { try { Product checkProduct = CatalogBLL.Product_Get(id); if (checkProduct == null) { return(RedirectToAction("Index")); } var model = new Models.AttributeResult { Data = CatalogBLL.Product_GetAttribute(id), }; return(Json(new { model.Data }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(RedirectToAction("Index")); } }
public ActionResult Attribute(string id = "") { try { Product checkProduct = CatalogBLL.Product_Get(id); if (checkProduct == null) { return(RedirectToAction("Index")); } var model = new Models.AttributeResult { Data = CatalogBLL.Product_GetAttribute(id), ProductID = Convert.ToInt32(id) }; return(View(model)); } catch (Exception e) { return(RedirectToAction("Index")); } }
public ActionResult Attribute(string id = "") { try { Product checkProduct = CatalogBLL.Product_Get(id); List <ProductAttributes> data = new List <ProductAttributes>(); data = CatalogBLL.Product_GetAttribute(id); if (data == null) { ProductAttributes newAttribute = new ProductAttributes(); return(View(newAttribute)); } var model = new Models.AttributeResult() { Data = data, }; return(View(model)); } catch (Exception e) { return(RedirectToAction("Index")); } }