/// <summary> /// Возвращает представление со списком отзывов пользователей /// </summary> /// <returns></returns> public async Task <ActionResult> ViewFeedbacks(string author, string category, int?page, FeedbackOrderBy orderBy = FeedbackOrderBy.Date) { var model = new IndexViewModel(_repository, _creator); await model.Initialize(author, category, orderBy, page ?? 1); return(View(model)); }
public ActionResult Index() { IndexViewModel viewModel = new IndexViewModel(); viewModel.Initialize(repository); return(View(viewModel)); }
public ActionResult Save(IndexViewModel viewModel) { viewModel.Initialize(repository); if (ModelState.IsValid) { viewModel.Save(); return(RedirectToAction("Index")); } else { return(View("Index", viewModel)); } }
public ActionResult Categorise(IndexViewModel vm) { vm.Initialize(Db); if (TryValidateModel(vm.Categorisation)) { foreach (var trx in vm.AllTransactions) { trx.Category = vm.Categorisation.Category; } Db.SaveChanges(); if (vm.Categorisation.CreateRule) { var rule = Db.CategorisationRules.Add(new CategorisationRule(vm.Search.Search, vm.Categorisation.Category)); Db.SaveChanges(); } return(RedirectToAction("Index", new IndexViewModel(vm.Search).ToRouteValues())); } else { vm.Categorisation.Show(); return(View("Index", vm)); } }
public ActionResult Index(IndexViewModel vm) { vm.Initialize(Db); return(View(vm)); }