Exemplo n.º 1
0
 public ActionResult Index()
 {
     SysUserSearchModels userList = new SysUserSearchModels();
     SysUserDAO userDAO = new SysUserDAO(this.mapper);
     userList.pageIndex = 1;
     userList = userDAO.searchUser(userList);
     return View(userList);
 }
Exemplo n.º 2
0
        public SysUserSearchModels searchUser(SysUserSearchModels model)
        {
            Dictionary<string, object> param = new Dictionary<string, object>();

            if (!StringUtils.IsEmpty(model.userCode))
            {
                param.Add("userCode", model.userCode);
            }
            if (!StringUtils.IsEmpty(model.fullName))
            {
                param.Add("fullName", model.fullName.ToUpper());
            }

            int maxItemPerPage = Constants.MaxItemPerPage;
            param.Add("max", model.pageIndex * maxItemPerPage);
            param.Add("offset", (model.pageIndex - 1) * maxItemPerPage + 1);
            model.userList = mapper.QueryForList<SysUserModels>("Sys.selectUserList", param);

            model.recordCount = mapper.QueryForObject<int>("Sys.selectCountUserList", param);
            return model;
        }
Exemplo n.º 3
0
 public ActionResult Search(SysUserSearchModels userList)
 {
     SysUserDAO userDAO = new SysUserDAO(this.mapper);
     userList = userDAO.searchUser(userList);
     return View("Index", userList);
 }