public ActionResult SearchAccounts(AccountSearchModel search, int pageSize) { if (Request.IsAjaxRequest()) { if (ModelState.IsValid) { var model = new SortAndPageModel { CurrentPageIndex = 1, SortBy = "", SortDescending = false, PageSize = pageSize }; int totalRecords; ViewBag.Accounts = _accountSvc.GetAllAccount(out totalRecords, model.CurrentPageIndex, pageSize, descending: true, loginName: search.LoginName); model.TotalRecordCount = totalRecords; ViewBag.SortAndPage = model; } ViewBag.ModelSearch = search; } return(PartialView("Partial", ViewBag.Accounts)); }
public List <AccountViewModel> Search(AccountSearchModel searchModel) { var result = _db.Accounts.Include(x => x.Role).Select(x => new AccountViewModel { Id = x.Id, Fullname = x.Fullname, Username = x.Username, Mobile = x.Mobile, ProfilePhoto = x.ProfilePhoto, Role = x.Role.Name, RegisteredDate = x.CreationDate.ToFarsi() }).AsNoTracking(); if (searchModel.RoleId != 0) { result = result.Where(x => x.RoleId == searchModel.RoleId); } if (!string.IsNullOrWhiteSpace(searchModel.Fullname)) { result = result.Where(x => x.Fullname.Contains(searchModel.Fullname)); } if (!string.IsNullOrWhiteSpace(searchModel.Mobile)) { result = result.Where(x => x.Fullname.Contains(searchModel.Mobile)); } if (!string.IsNullOrWhiteSpace(searchModel.Username)) { result = result.Where(x => x.Username.Contains(searchModel.Username)); } return(result.OrderByDescending(x => x.Id).ToList()); }
public JsonResult FetchAccountList(AccountSearchModel Smodel) { string errMessage = string.Empty; if (ModelState.IsValid) { var validation = SecurityController.ValidateToken(Smodel.TokenCode); try { if (validation.Validated == true) { var AccListResult = _db.Query <AccountListModel>(";Exec Supreme_AccountListing @Offset,@SearchTypeID,@SearchStatement", new { Offset = Smodel.Offset, SearchTypeID = Smodel.SearchTypeID, SearchStatement = Smodel.SearchStatement }).ToList(); logger.LogWrite(JsonConvert.SerializeObject(Smodel).ToString() + ":-" + JsonConvert.SerializeObject(AccListResult).ToString()); return(Json(AccListResult, JsonRequestBehavior.AllowGet)); } else { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = validation.Errors[0].ToString(); logger.LogWrite(JsonConvert.SerializeObject(validation).ToString()); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } catch (Exception ee) { GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = ee.Message; GeneralService.WriteErrorLog(ref ee); return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } } else { var message = string.Join(" | ", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); GenericResultModel AccListResult2 = new GenericResultModel(); AccListResult2.Status = "Fail"; AccListResult2.Remarks = message; return(Json(AccListResult2, JsonRequestBehavior.AllowGet)); } //return Json(UserListResult, JsonRequestBehavior.AllowGet); }
public IQueryable <AccountIndexViewModel> GetAccountTable(AccountSearchModel searchModel) { IQueryable <Account> table = AdapterFJRepository.AccountRepository.GetAll(); var Atable = table.Select(p => new AccountIndexViewModel { AccountUser = p.AccountUser, IdentityCode = p.IdentityCode, Winery = p.Winery.WineryName, UserName = p.UserName }); return(Atable); }
public JsonResult LoadAccountData(AccountSearchModel model, GridPager pager) { var pagerTuple = Tuple.Create(pager.SortColumn, pager.OrderBy, pager.Page, pager.Size, 0, 0); var result = _component.GetAccountRecordList(model.Username, ref pagerTuple); pager.Count = pagerTuple.Item5; pager.TotalPage = pagerTuple.Item6; var models = result.ToGridJson(pager, item => new { Id = item.Id, Username = item.Username, MerchantName = item.MerchantName == null ? "" : item.MerchantName, Cellphone = item.Cellphone, Email = item.Email == null ? "" : item.Email, Status = item.Status, Operate = item.Id }); return(Json(models, JsonRequestBehavior.AllowGet)); }
public List <AccountViewModel> Search(AccountSearchModel searchModel) { var query = _context.Accounts.Include(x => x.Role).Select(x => new AccountViewModel { Id = x.Id, Fullname = x.Fullname, Mobile = x.Mobile, ProfilePhoto = x.ProfilePhoto, Role = x.Role.Name, RoleId = x.RoleId, Username = x.Username, CreationDate = x.CreateionDate.ToFarsi() }); if (!string.IsNullOrWhiteSpace(searchModel.Fullname)) { query = query.Where(x => x.Fullname.Contains(searchModel.Fullname)); } if (!string.IsNullOrWhiteSpace(searchModel.Username)) { query = query.Where(x => x.Username.Contains(searchModel.Username)); } if (!string.IsNullOrWhiteSpace(searchModel.Mobile)) { query = query.Where(x => x.Mobile.Contains(searchModel.Mobile)); } if (searchModel.RoleId > 0) { query = query.Where(x => x.RoleId == searchModel.RoleId); } return(query.OrderByDescending(x => x.Id).ToList()); }
public List <AccountViewModel> Search(AccountSearchModel searchModel) { var query = _context.Accounts .Include(c => c.Role) .Select(c => new AccountViewModel() { Id = c.Id, Mobile = c.Mobile, Username = c.Username, FullName = c.FullName, ProfilePicture = c.ProfilePicture, RoleName = c.Role.Name, RoleId = c.RoleId, RegisterDate = c.CreationDate.ToFarsi() }).AsNoTracking(); if (!string.IsNullOrWhiteSpace(searchModel.FullName)) { query = query.Where(c => c.FullName.Contains(searchModel.FullName)); } if (!string.IsNullOrWhiteSpace(searchModel.UserName)) { query = query.Where(c => c.Username.Contains(searchModel.UserName)); } if (!string.IsNullOrWhiteSpace(searchModel.Mobile)) { query = query.Where(c => c.Mobile.Contains(searchModel.Mobile)); } if (searchModel.RoleId > 0) { query = query.Where(c => c.RoleId == searchModel.RoleId); } return(query.ToList()); }
public ActionResult List(AccountSearchModel accountSearchModel) { int pageIndex = accountSearchModel.Page ?? 1; var data = _userService.GetAll().Where(x => (string.IsNullOrEmpty(accountSearchModel.UserName) || x.FirstName.ToLower().Trim() .Contains(accountSearchModel.UserName.ToLower().Trim())) && (string.IsNullOrEmpty(accountSearchModel.eMail) || x.eMail.ToLower().Trim().Contains(accountSearchModel.eMail.ToLower().Trim())) ).ToList(); var accountList = _mapper.Map <List <AccountModel> >(data); accountSearchModel.AccountList = accountList.ToPagedList(pageIndex, 10); if (Request.IsAjaxRequest()) { return(PartialView("_accountList", accountSearchModel)); } return(View(accountSearchModel)); }
public void OnGet(AccountSearchModel searchModel) { Roles = new SelectList(_roleApplication.List(), "Id", "Name"); Account = _accountApplication.Search(searchModel); }
public List <AccountViewModel> Search(AccountSearchModel searchModel) { return(_accountRepository.Search(searchModel)); }
public ActionResult GetIndexTable(AccountSearchModel searchModel) { return(View("_IndexAccountTable", AccountBL.GetAccountTable(searchModel))); }
/// <summary> /// 管理员列表 /// </summary> /// <param name="model"></param> /// <returns></returns> public ResponsResult GetBackstageUserList(AccountSearchModel model) { ResponsResult result = new ResponsResult(); var query = base.Query <BackstageUser>(); if (!string.IsNullOrEmpty(model.FullName)) { query = query.Where(t => t.FullName.Contains(model.FullName)); } if (!string.IsNullOrEmpty(model.Mobile)) { query = query.Where(t => t.Mobile == model.Mobile); } if (model.AccountStatus != null && (int)model.AccountStatus > 0) { query = query.Where(t => t.AccountStatus == (int)model.AccountStatus); } if (model.BeginTime.HasValue) { query = query.Where(t => t.CreateTime >= model.BeginTime); } if (model.EndTime.HasValue) { query = query.Where(t => t.CreateTime <= model.EndTime); } var objList = query.OrderByDescending(t => t.CreateTime).Pages(model.PageIndex, model.PageSize, out int count). Select(t => new { t.Id, roleName = t.Role.Name, t.AccountStatus, t.FullName, t.SourceType, t.CreateTime, t.LastLoginTime, t.LastLoginIp, t.Mobile, t.LoginName, t.UpdateTime, t.IdCard, t.AccountType }).ToList(); List <AccountSearchModel> _list = new List <AccountSearchModel>(); objList.ForEach(t => _list.Add( new AccountSearchModel { Id = t.Id, RoleName = t.roleName, AccountStatusName = ((AccountStatus)t.AccountStatus).GetString(), FullName = t.FullName, SourceTypeName = ((SourceType)t.SourceType).GetString(), CreateTime = t.CreateTime, LastLoginTime = t.LastLoginTime, LastLoginIp = t.LastLoginIp, Mobile = t.Mobile, LoginName = t.LoginName, UpdateTime = t.UpdateTime, AccountStatus = (AccountStatus)t.AccountStatus, IdCard = t.IdCard, AccountType = (AccountType)t.AccountType } )); result.Data = _list; result.RecordCount = count; return(result); }
public AccountViewModel(AccountDetailModel detailModel, AccountSearchModel searchModel) { _detailModel = detailModel; _searchModel = searchModel; }
public void OnGet(AccountSearchModel searchModel) { Role = _roleApplication.List(); }
public void OnGet(AccountSearchModel searchModel) { Accounts = _accountApplication.Search(searchModel); Roles = new SelectList(_roleApplication.GetRoles(), "Id", "Title"); }
public MyResult <object> BackstageUser([FromBody] AccountSearchModel model) { return(AccountService.GetBackstageUserList(model)); }
public ResponsResult BackstageUser([FromBody] AccountSearchModel model) { return(accountService.GetBackstageUserList(model)); }