Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AuthorityMaster authorityMaster = db.AuthorityMasters.Find(id);

            db.AuthorityMasters.Remove(authorityMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "AuthorityId,AuthorityName,AuthorityCode")] AuthorityMaster authorityMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(authorityMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(authorityMaster));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "AuthorityId,AuthorityName,AuthorityCode")] AuthorityMaster authorityMaster)
        {
            if (ModelState.IsValid)
            {
                db.AuthorityMasters.Add(authorityMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(authorityMaster));
        }
Пример #4
0
        // GET: AuthorityMasters/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AuthorityMaster authorityMaster = db.AuthorityMasters.Find(id);

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