Exemplo n.º 1
0
 public void addAuth(AuthListModel al)
 {
     this.Authorises.Insert(new Authorise {
         Name        = al.Name,
         Description = al.Description
     });
 }
Exemplo n.º 2
0
        public void updateAuth(AuthListModel a)
        {
            //var auth = this.Authorises.Find(n => n.AuthoriseID == a.AuthoriseID);
            var auth = this.Authorises.GetById(a.AuthoriseID);

            auth.Name        = a.Name;
            auth.Description = a.Description;
            this.Authorises.Update(auth);
        }
Exemplo n.º 3
0
        public AuthListModel GetSelectAuth(int authid)
        {
            //var a = this.Authorises.Find(n => n.AuthoriseID == authid);
            var a  = this.Authorises.GetById(authid);
            var al = new AuthListModel
            {
                Name        = a.Name,
                Description = a.Description,
                AuthoriseID = a.AuthoriseID
            };

            return(al);
        }
Exemplo n.º 4
0
 public ActionResult AddAuth(AuthListModel al)
 {
     if (this.webservice.AuthExit(al.Name))
     {
         ModelState.AddModelError("Name", "角色名已存在");
     }
     else
     {
         this.webservice.addAuth(al);
         ModelState.AddModelError("", "角色添加成功!");
     }
     return(View());
 }
Exemplo n.º 5
0
 public ActionResult AuthEdit(AuthListModel al)
 {
     this.webservice.updateAuth(al);
     ModelState.AddModelError("", "修改成功!");
     return(View());
 }