public ActionResult SystemList(VMUserSeacher search) { VMUser result = new VMUser(); result.Userlist = SystemMapper.Userlist(user.UserList(search.UsersState, search.UsersName, search.NowPage)); result.count = user.UsersList(search.UsersState, search.UsersName); result.AllPage = Paging.SumPage(result.count, 10); result.NowPage = search.NowPage; result.NewPage = (result.AllPage == 0) ? 0 : result.NowPage + 1; result.UserName = ""; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult SystemList(int NowPage = 0) { VMUser Result = new VMUser(); Result.list = JsonConvert.SerializeObject(SystemMapper.Userlist(user.UserList())); Result.count = user.UsersList(); Result.AllPage = Paging.SumPage(Result.count, 10); Result.NowPage = NowPage; Result.NewPage = (Result.AllPage == 0) ? 0 : Result.NowPage + 1; Result.UserName = ""; return(View(Result)); }
public ActionResult UserAdd(VMAddUserInfo addUser) { VMUser vmUser = new VMUser(); try { user.UserAdd(addUser.UserCategory, addUser.UserState, addUser.UserName, addUser.UserPassword, addUser.UserLevel); vmUser.msg = "添加成功!"; } catch (Exception ex) { vmUser.msg = ex.Message; } vmUser.Userlist = SystemMapper.Userlist(user.UserList()); vmUser.count = user.UsersList(); vmUser.AllPage = Paging.SumPage(vmUser.count, 10); vmUser.NowPage = addUser.NowPage; vmUser.NewPage = (vmUser.AllPage == 0) ? 0 : vmUser.NowPage + 1; vmUser.UserName = ""; return(Json(vmUser, JsonRequestBehavior.AllowGet)); }