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;
        }
Пример #2
0
        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");
     }
 }
Пример #4
0
 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");
     }
 }
Пример #5
0
 public void Update(tbl_Category url)
 {
     objDb.Update(url);
 }
Пример #6
0
 public void Insert(tbl_Category url)
 {
     objDb.Insert(url);
 }
Пример #7
0
 public void Update(tbl_Category url)
 {
     db.Entry(url).State = System.Data.Entity.EntityState.Modified;
 }
Пример #8
0
 public void Insert(tbl_Category url)
 {
     db.tbl_Category.Add(url);
     Save();
 }
Пример #9
0
 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();
 }