public ActionResult UpdateCategory(TBLCATEGORY p) { var category = entities.TBLCATEGORY.Find(p.ID); category.CategoryName = p.CategoryName; entities.SaveChanges(); return(RedirectToAction("Index")); }
protected void Button1_Click(object sender, EventArgs e) { DBBlogFilmEntities db = new DBBlogFilmEntities(); TBLCATEGORY t = new TBLCATEGORY(); t.CATNAME = txtCat.Text; db.TBLCATEGORY.Add(t); db.SaveChanges(); Response.Redirect("ACategoryIndex.aspx"); }
public ActionResult AddNewCategory(TBLCATEGORY p) { entities.TBLCATEGORY.Add(p); entities.SaveChanges(); return(RedirectToAction("Index")); }