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

            if (tbl_zonelist == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_zonelist));
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "id,serialNo,name,address,codeNo")] tbl_ZoneList tbl_zonelist)
        {
            if (ModelState.IsValid)
            {
                db.tbl_ZoneList.Add(tbl_zonelist);
                ViewBag.message = "Zone Created Succesfully";
                db.SaveChanges();

                ModelState.Clear();
                return(View());
                //return RedirectToAction("Index");
            }

            return(View(tbl_zonelist));
        }
Exemple #4
0
        public JsonResult DeleteConfirmed(int id)
        {
            string success = string.Empty;
            // return Json(success, JsonRequestBehavior.AllowGet);
            tbl_ZoneList tbl_zonelist = db.tbl_ZoneList.Find(id);

            db.tbl_ZoneList.Remove(tbl_zonelist);
            int result = db.SaveChanges();

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

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