示例#1
0
 public ActionResult Edit([Bind(Include = "id,name,address")] tbl_ShopList tbl_shoplist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_shoplist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_shoplist));
 }
示例#2
0
        // GET: /Shop/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_ShopList tbl_shoplist = db.tbl_ShopList.Find(id);

            if (tbl_shoplist == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_shoplist));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "id,name,address")] tbl_ShopList tbl_shoplist)
        {
            if (ModelState.IsValid)
            {
                db.tbl_ShopList.Add(tbl_shoplist);
                ViewBag.massage = "Shop Created Succesfully";
                db.SaveChanges();

                ModelState.Clear();
                return(View());
            }

            return(View(tbl_shoplist));
        }
示例#4
0
        public JsonResult DeleteConfirmed(int id)
        {
            string success = string.Empty;
            // return Json(success, JsonRequestBehavior.AllowGet);
            tbl_ShopList tbl_shoplist = db.tbl_ShopList.Find(id);

            db.tbl_ShopList.Remove(tbl_shoplist);
            int result = db.SaveChanges();

            if (result > 0)
            {
                success = "Data delete successfully";
            }
            //  return Json(success, JsonRequestBehavior.AllowGet);

            return(Json(new { result = success }));
        }