public ActionResult Delete(int?id)
        {
            group_role group_role = db.group_role.Find(id);

            db.group_role.Remove(group_role);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "gr_id,gr_name,gr_description,gr_status")] group_role group_role)
 {
     if (ModelState.IsValid)
     {
         db.Entry(group_role).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(group_role));
 }
示例#3
0
        public void Update(group_role gr)
        {
            group_role group_role = GetById(gr.gr_id);

            if (group_role != null)
            {
                group_role.gr_name        = gr.gr_name;
                group_role.gr_description = gr.gr_description;
                db.SaveChanges();
            }
        }
        public ActionResult Create([Bind(Include = "gr_id,gr_name,gr_description,gr_status")] group_role group_role)
        {
            if (ModelState.IsValid)
            {
                db.group_role.Add(group_role);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(group_role));
        }
示例#5
0
        public int Delete(int id)
        {
            group_role gr = db.group_role.Find(id);

            if (gr != null)
            {
                db.group_role.Remove(gr);
                return(db.SaveChanges());
            }
            else
            {
                return(-1);
            }
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            group_role group_role = db.group_role.Find(id);

            if (group_role == null)
            {
                return(HttpNotFound());
            }
            return(View(group_role));
        }
示例#7
0
 public void Create(group_role gr)
 {
     db.group_role.Add(gr);
     db.SaveChanges();
 }