public void Update(tbl_Category cat) { //db.Entry(cat).State = EntityState.Modified; db.Entry(cat).State = EntityState.Modified; db.Configuration.ValidateOnSaveEnabled = false; Save(); db.Configuration.ValidateOnSaveEnabled = true; }
public ActionResult Create(tbl_Category model) { if (!ModelState.IsValid) return View("Index"); try { objBs.categoryBs.Insert(model); TempData["Msg"] = "Created Successfully"; } catch (Exception exception) { TempData["Msg"] = "Create Failed : " + exception.Message; } return RedirectToAction("Index"); }
public ActionResult Create(tbl_Category category) { try { if (ModelState.IsValid) { _objBl.categoryBl.Insert(category); TempData["Msg"] = "Created Successfully!"; return RedirectToAction("Index"); } else { return View("Index"); } } catch (Exception e1) { TempData["Msg"] = "Insertion Fail: " + e1.Message + " Error relate to: " + e1.Source; return RedirectToAction("Index"); } }
public ActionResult Create(tbl_Category category) { try { if (ModelState.IsValid) { objBs.categoryBs.Insert(category); TempData["Msg"] = "Created Successfully"; return RedirectToAction("Index"); } else { return View("Index"); } } catch (Exception e1) { TempData["Msg"] = "Create Failed : " + e1.Message; return RedirectToAction("Index"); } }
public void Update(tbl_Category url) { objDb.Update(url); }
public void Insert(tbl_Category url) { objDb.Insert(url); }
public void Update(tbl_Category url) { db.Entry(url).State = System.Data.Entity.EntityState.Modified; }
public void Insert(tbl_Category url) { db.tbl_Category.Add(url); Save(); }
public void Update(tbl_Category category) { db.Entry(category).State = EntityState.Modified; Save(); }
public void Insert(tbl_Category cat) { db.tbl_Category.Add(cat); Save(); }