Пример #1
0
 public ActionResult GetList(int page = 1)
 {
     PagerInfo pi = new PagerInfo();
     pi.CurrenetPageIndex = page;
     ObjEntity list = new Sys_RoleDAL().GetList(pi);
     return Json(new { data = list.ResultData, pager = list.ResultPager });
 }
Пример #2
0
 public ActionResult Logins(string account, string password)
 {
     ErrorResult result = new ErrorResult();
     Sys_User entity = new Sys_UserDAL().Login(account, password);
     if (entity != null)
     {
         var count = 0;
         result.Flag = true;
         List<SysTemplateViewModel> template = new List<SysTemplateViewModel>();
         LoginUser model = new LoginUser();
         model.DeptId = entity.DeptId;
         model.UserId = entity.Id;
         model.UserName = entity.Account;
         List<Sys_UserRole> userRoleList = new Sys_UserRoleDAL().GetList(entity.Id);
         if (userRoleList != null && userRoleList.Count > 0)
         {
             Session["RoleName"] = new Sys_RoleDAL().GetModel(userRoleList[0].RoleId).RoleName;
             foreach (var item in userRoleList)
             {
                 List<SysTemplateViewModel> templateItemList = new Sys_TemplateDAL().GetViewListByRoleId(item.RoleId);
                 template.AddRange(templateItemList);
                 template.Union(templateItemList).ToList();
             }
         }
         Session["UserName"] = model.UserName;
         model.UserRoleList = userRoleList;
         model.ActionList = template;
         Session["data"] = model;
         Session["menu"] = template;
         SessionHelper.Add("Re_USER_OBJ", model.UserName, 60);
     }
     else
     {
         result.Flag = false;
         result.Message = "用户名或者密码";
     }
     return Json(result);
 }
Пример #3
0
 public ActionResult GetLists()
 {
     List<Sys_Role> list = new Sys_RoleDAL().GetList();
     return Json(list,JsonRequestBehavior.AllowGet);
 }