示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CountryTbl countryTbl = db.CountryTbls.Find(id);

            db.CountryTbls.Remove(countryTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Name,IsActive")] CountryTbl countryTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(countryTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(countryTbl));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Id,Name,IsActive")] CountryTbl countryTbl)
        {
            if (ModelState.IsValid)
            {
                db.CountryTbls.Add(countryTbl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(countryTbl));
        }
示例#4
0
        // GET: Admin/CountryTbls/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CountryTbl countryTbl = db.CountryTbls.Find(id);

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