public IActionResult List(string categoryName) { var model = new CategoryListViewModel { Categories = _categoryService.GetByName(categoryName) }; return(View(model)); }
public IActionResult Index() { CategoryListViewModel categoryListViewModel = new CategoryListViewModel() { Categories = _categoryServices.GetAll() }; return(View(categoryListViewModel)); }
public ActionResult Index() { var model = new CategoryListViewModel { Categories = _categoryManager.GetAll() }; return(View(model)); }
public ViewViewComponentResult Invoke() { CategoryListViewModel model = new CategoryListViewModel { Categories = _categoryService.GetAll(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["categoryId"]) }; return View(model); }
public ViewViewComponentResult Invoke() { var model = new CategoryListViewModel { Categories = _categoryDal.GetList() }; return(View(model)); }
private void RemoveCategory_Click(object sender, RoutedEventArgs e) { if (sender is Button button && button.DataContext is Category category) { CategoryListViewModel vm = DataContext as CategoryListViewModel; App.AvailableCategories.Remove(category); vm.ForceUpdateList(); } }
public async Task <IActionResult> Index(string name = GlobalConstants.CoffeeName) { var viewModel = new CategoryListViewModel { Categories = await this.categoryService.GetAllByNameAsync <CategoryInListViewModel>(name), }; return(this.View(viewModel)); }
public IActionResult AddCategory(CategoryListViewModel model) { if (ModelState.IsValid) { categoryRepository.Create(model.Category); return(RedirectToAction("Category")); } return(RedirectToAction("Category")); }
public ViewResult List() { CategoryListViewModel model = new CategoryListViewModel { Categories = unitOfWork.CategoryRepository.Get(null, x => x.OrderBy(o => o.Id)).Distinct() }; return(View(model)); }
public ActionResult Categories() { CategoryListViewModel model = new CategoryListViewModel { Categories = _categoryService.GetAll() }; return(View(model)); }
public async Task <IViewComponentResult> InvokeAsync() { var viewModel = new CategoryListViewModel { Categories = await this.categoryService.GetAllAsync <CategoryInListViewModel>(), }; return(this.View(viewModel)); }
public ViewViewComponentResult Invoke() { CategoryListViewModel model = new CategoryListViewModel() { Categories = _categoryService.GetAllCategories(), SubCategories = _subCategoryService.GetAll(), }; return(View(model)); }
public IViewComponentResult Invoke() { var model = new CategoryListViewModel() { SelectedCategory = RouteData.Values["category"]?.ToString(),//? dememin sebebi category null değilse string e çevirecek. Null ise stringe çevirmeye gerek kalmayacak. ? yazmazsak olmayan kategory i string e çevirmeye çalışacak ve hata verir Categories = _categoryService.GetAll() }; return(View(model)); }
public IActionResult DeleteCategory(CategoryListViewModel model) { if (ModelState.IsValid) { categoryRepository.Delete(model.Category); return(RedirectToAction("Category")); } ModelState.AddModelError("", "Error"); return(RedirectToAction("Category")); }
private CategoryListViewModel GetCategoryListFromCategoryManager(string category) { var entries = !string.IsNullOrEmpty(category) ? categoryManager.GetEntries(category, httpContextAccessor.HttpContext.Request.Headers["Accept-Language"]) : categoryManager.GetEntries(); var viewModel = CategoryListViewModel.Create(entries); return(viewModel); }
public ViewViewComponentResult Invoke() { var items = _categoryService.GetAll(); var model = new CategoryListViewModel() { Categories = items }; return(View(model)); }
public async Task <IActionResult> List([FromQuery] QueryParams queryParams) { var viewModel = new CategoryListViewModel { Categories = await _categoryService.GetPagedCategoriesAsync(queryParams), q = queryParams.q }; return(View(viewModel)); }
public PartialViewResult CategoryList() { CategoryListViewModel model = new CategoryListViewModel { CurrentCategory = Convert.ToInt32(Session["category"]), Categories = _CategoryService.GetAll(0) }; return(PartialView(model)); }
public IViewComponentResult Invoke() { var viewModel = new CategoryListViewModel { CategoryNames = this.categoriesService.GetAllProductCategories <CategoryViewModel>(), }; return(this.View(viewModel)); }
public ViewViewComponentResult Invoke() { var model = new CategoryListViewModel { Categories = _categoryService.GetAll().OrderBy(c => c.Name).ToList(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["category"]) }; return(View(model)); }
public IViewComponentResult Invoke() { CategoryListViewModel model = new CategoryListViewModel() { Categories = _categoryService.GetAll(), SelectedCategory = RouteData.Values["category"]?.ToString() }; return(View(model)); }
public ViewViewComponentResult Invoke() //uyandırmak gibi anlmaı var { var model = new CategoryListViewModel { Categories = _categoryService.GetAll(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["category"]) }; return(View(model)); }
public IViewComponentResult Invoke() { var model = new CategoryListViewModel() { Categories = _categoryService.GetList(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["category"]) }; return(View(model)); }
public ViewViewComponentResult Invoke() { var model = new CategoryListViewModel() { Categories = _categoryService.GetAll(), CurrenCategory = Convert.ToInt32(HttpContext.Request.Query["category"]) }; return(View("/Views/Components/CategoryList/Default.cshtml", model)); }
public ViewViewComponentResult Invoke() { CategoryListViewModel model = new CategoryListViewModel { Categories = _repo.GetAll().ToList(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["search"]) }; return(View(model)); }
public UIElement GetListView() { CategoryListViewModel viewModel = new CategoryListViewModel(factory, this); CategoryListView view = new CategoryListView(viewModel); Window window = WindowFactory.CreateByContentsSize(view); viewModel.CategorySelected += (s, e) => OnSelect(e.Data); return(view); }
//<<<<<<< HEAD // // GET: dashboardCategory // [AuthorizeMaster] // public ActionResult Index() //======= // // GET: dashboardCategory' // //public ActionResult Index() // //{ // // return View(); // //} // //[HttpPost] public ActionResult Index(/*CategoryViewModel input*/) { CategoryService cs = new CategoryService(); CategoryListViewModel result = cs.GetAllCategory(); //SubCategoryViewModel results = cs.AddSubCategory(); return(View(result)); }
public ViewViewComponentResult Invoke() { var model = new CategoryListViewModel { //Kategori listemizi partial kullanmak istediğimizi varsayalım. Categories = _categoryRepository.GetAll().ToList() }; return(View(model)); }
public ViewViewComponentResult Invoke() { var model = new CategoryListViewModel { Categories = _categoryService.GetAll(), CurrentCategory = Convert.ToInt32(HttpContext.Request.Query["category"]) //tıkladığım category belli olsun diye }; return(View(model)); }
public IActionResult CategoryList() { var categories = _categoryService.GetAll(); var categoryListViewModel = new CategoryListViewModel() { Categories = categories }; return(View(categoryListViewModel)); }
public void Loaded_PropertiesSet() { var categoryRepoSetup = new Mock<ICategoryRepository>(); categoryRepoSetup.Setup(x => x.GetList(null)).Returns(() => new List<CategoryViewModel> { new CategoryViewModel {Name = string.Empty} }); var vm = new CategoryListViewModel(categoryRepoSetup.Object, new Mock<IModifyDialogService>().Object, new Mock<IDialogService>().Object); vm.LoadedCommand.Execute(); vm.Source.ShouldNotBeNull(); }
public PartialViewResult ListMainCategories() { using (UnitOfWorkManager.NewUnitOfWork()) { var catViewModel = new CategoryListViewModel { AllPermissionSets = ViewModelMapping.GetPermissionsForCategories(_categoryService.GetAllMainCategories(), _roleService, UsersRole) }; return PartialView(catViewModel); } }
public ActionResult Show(string slug, int? p) { using (UnitOfWorkManager.NewUnitOfWork()) { // Get the category var category = _categoryService.GetBySlugWithSubCategories(slug); // Allowed Categories for this user var allowedCategories = _categoryService.GetAllowedCategories(UsersRole); // Set the page index var pageIndex = p ?? 1; // check the user has permission to this category var permissions = RoleService.GetPermissions(category.Category, UsersRole); if (!permissions[SiteConstants.Instance.PermissionDenyAccess].IsTicked) { var topics = _topicService.GetPagedTopicsByCategory(pageIndex, SettingsService.GetSettings().TopicsPerPage, int.MaxValue, category.Category.Id); var topicViewModels = ViewModelMapping.CreateTopicViewModels(topics.ToList(), RoleService, UsersRole, LoggedOnReadOnlyUser, allowedCategories, SettingsService.GetSettings()); // Create the main view model for the category var viewModel = new CategoryViewModel { Permissions = permissions, Topics = topicViewModels, Category = category.Category, PageIndex = pageIndex, TotalCount = topics.TotalCount, TotalPages = topics.TotalPages, User = LoggedOnReadOnlyUser, IsSubscribed = UserIsAuthenticated && (_categoryNotificationService.GetByUserAndCategory(LoggedOnReadOnlyUser, category.Category).Any()) }; // If there are subcategories then add then with their permissions if (category.SubCategories.Any()) { var subCatViewModel = new CategoryListViewModel { AllPermissionSets = new Dictionary<Category, PermissionSet>() }; foreach (var subCategory in category.SubCategories) { var permissionSet = RoleService.GetPermissions(subCategory, UsersRole); subCatViewModel.AllPermissionSets.Add(subCategory, permissionSet); } viewModel.SubCategories = subCatViewModel; } return View(viewModel); } return ErrorToHomePage(LocalizationService.GetResourceString("Errors.NoPermission")); } }