public ActionResult DeleteConfirmed(long id)
        {
            MainCategoryTbl mainCategoryTbl = db.MainCategoryTbls.Find(id);

            db.MainCategoryTbls.Remove(mainCategoryTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "MainCategoryID,MainCategory")] MainCategoryTbl mainCategoryTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mainCategoryTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mainCategoryTbl));
 }
        public ActionResult Create([Bind(Include = "MainCategoryID,MainCategory")] MainCategoryTbl mainCategoryTbl)
        {
            if (ModelState.IsValid)
            {
                db.MainCategoryTbls.Add(mainCategoryTbl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mainCategoryTbl));
        }
        // GET: Store/MainCategory/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MainCategoryTbl mainCategoryTbl = db.MainCategoryTbls.Find(id);

            if (mainCategoryTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(mainCategoryTbl));
        }