public ActionResult Index(string id = "Undefined") { var condition = new ConditionViewModel <UserFile>() { ChangeOrderDirection = false, OrderDirection = "desc" }; if (string.IsNullOrEmpty(id)) { condition.Func = d => d.Deleted != true && d.Category == "Undefined"; } else { condition.Func = d => d.Deleted != true && d.Category == id; } condition.PerPageSize = 300; condition.CurrentPage = 1; var viewModel = new UploadFileViewModel(); viewModel.CategoryList = _db.Get <UserFile>(d => d.Deleted != true).GroupBy(d => d.Category).Select(g => new SelectListItem { Text = g.Key, Value = g.Key, Selected = g.Key == id }).ToArray(); viewModel.Data = _db.GetSearchResult(condition, d => d.OperationDate, null); return(View(viewModel)); }
public ActionResult Index() { //ApplicationUser tem = new ApplicationUser(); var models = _context.GetSearchResult(new ConditionViewModel <ApplicationUser>() { Func = t => t.PasswordHash != null, ChangeOrderDirection = false, OrderDirection = "desc" }, d => d.UpdateDatetime, new string[] { "Roles" }, true); var target = Mapper.Map <ConditionViewModelTarget <OperatorViewModel> >(models); var temp = models.Data.Project().To <OperatorViewModel>().ToList(); foreach (var item in temp) { item.IdForJS = item.Id.Replace("-", ""); } target.Data = temp; return(View(target)); }
public ActionResult Index() { ViewBag.selected = 1; var models = _context.GetSearchResult(new ConditionViewModel <ApplicationUser>() { ChangeOrderDirection = false, OrderDirection = "desc" }, d => d.UpdateDatetime, null, true); return(View(models)); }