Esempio n. 1
0
        public ActionResult UpdateCategory(TBLCATEGORY p)
        {
            var category = entities.TBLCATEGORY.Find(p.ID);

            category.CategoryName = p.CategoryName;
            entities.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
 public ActionResult AddNewCategory(TBLCATEGORY p)
 {
     entities.TBLCATEGORY.Add(p);
     entities.SaveChanges();
     return(RedirectToAction("Index"));
 }