public ActionResult Productdetail(ProductModel Productdetail) { try { if (Productdetail.pro_id == 0) { result = bl.MasterTransaction("wb_product_list", "Insert", "pro_name,cat_id,created_date", "'" + Productdetail.pro_name + "','" + Productdetail.cat_id + "',GETDATE()", "", "", ""); } else { result = bl.MasterTransaction("wb_product_list", "Update", "", "pro_name='" + Productdetail.pro_name + "',cat_id='" + Productdetail.cat_id + "',edited_date=GETDATE()", "pro_id='" + Productdetail.pro_id + "'", "", ""); } if (result == "done") { TempData["AlertMessage"] = "Sucessfully Done"; } else { TempData["AlertMessage"] = result; } return(RedirectToAction("Product", "Product")); } catch (Exception ex) { TempData["AlertMessage"] = ex.ToString(); return(RedirectToAction("Product", "Product")); } }
public ActionResult Categorydetail(CategoryModel Categorydetail) { try { if (Categorydetail.cat_id == 0) { result = bl.MasterTransaction("wb_category_list", "Insert", "cat_name,created_date", "'" + Categorydetail.cat_name + "',GETDATE()", "", "", ""); } else { result = bl.MasterTransaction("wb_category_list", "Update", "", "cat_name='" + Categorydetail.cat_name + "',edited_date=GETDATE()", "cat_id='" + Categorydetail.cat_id + "'", "", ""); } if (result == "done") { TempData["AlertMessage"] = "Sucessfully Done"; } else { TempData["AlertMessage"] = result; } return(RedirectToAction("Category", "Category")); } catch (Exception ex) { TempData["AlertMessage"] = ex.ToString(); return(RedirectToAction("Category", "Category")); } }