示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Master_Roles master_Roles = db.Master_Roles.Find(id);

            db.Master_Roles.Remove(master_Roles);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "RoleId,RoleName,RoleKey")] Master_Roles master_Roles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(master_Roles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(master_Roles));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "RoleId,RoleName,RoleKey")] Master_Roles master_Roles)
        {
            if (ModelState.IsValid)
            {
                db.Master_Roles.Add(master_Roles);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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