Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StateTbl stateTbl = db.StateTbls.Find(id);

            db.StateTbls.Remove(stateTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,CountryId,IsActive")] StateTbl stateTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stateTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryId = new SelectList(db.CountryTbls, "Id", "Name", stateTbl.CountryId);
     return(View(stateTbl));
 }
Example #3
0
        // GET: Admin/StateTbls/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StateTbl stateTbl = db.StateTbls.Find(id);

            if (stateTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(stateTbl));
        }
Example #4
0
        // GET: Admin/StateTbls/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StateTbl stateTbl = db.StateTbls.Find(id);

            if (stateTbl == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CountryId = new SelectList(db.CountryTbls, "Id", "Name", stateTbl.CountryId);
            return(View(stateTbl));
        }