Exemplo n.º 1
0
        public IActionResult GetAllRole()
        {
            TRIGHT_ROLE_Da rolemanger = new TRIGHT_ROLE_Da();
            var            list       = rolemanger.CurrentDb.AsQueryable().OrderBy(s => s.ID).ToList();

            return(SuccessResultList(list));
        }
Exemplo n.º 2
0
 public IActionResult DelRole(int id)
 {
     DataAccess.TRIGHT_ROLE_Da da = new TRIGHT_ROLE_Da();
     if (da.CurrentDb.DeleteById(id))
     {
         return(SuccessMessage("成功!"));
     }
     return(FailMessage("失败!"));
 }
Exemplo n.º 3
0
        public IActionResult UpdateRole(TRIGHT_ROLE model)
        {
            if (string.IsNullOrEmpty(model.ROLENAME))
            {
                return(FailMessage("角色名不能为空!"));
            }



            DataAccess.TRIGHT_ROLE_Da da = new TRIGHT_ROLE_Da();
            if (da.CurrentDb.Update(model))
            {
                return(SuccessMessage("成功!"));
            }
            return(FailMessage("失败!"));
        }
Exemplo n.º 4
0
        public IActionResult AddRole(TRIGHT_ROLE model)
        {
            if (string.IsNullOrEmpty(model.ROLENAME))
            {
                return(FailMessage("角色名不能为空!"));
            }

            if (string.IsNullOrEmpty(model.REMARKS))
            {
                model.REMARKS = string.Empty;
            }

            DataAccess.TRIGHT_ROLE_Da da = new TRIGHT_ROLE_Da();
            if (da.CurrentDb.Insert(model))
            {
                return(SuccessMessage("成功!"));
            }
            return(FailMessage("失败!"));
        }
Exemplo n.º 5
0
        public IActionResult ListRole()
        {
            DataAccess.TRIGHT_ROLE_Da da = new TRIGHT_ROLE_Da();

            return(SuccessResultList(da.CurrentDb.GetList()));
        }