protected async Task DeleteCategory() { try { // Delete the Category var result = _categoryService.DeleteCategoryAsync(SelectedCategory); // If the current page has no records // and not on page one go back a page if ((CurrentPage > 1) && !((categories.PageSize - 1) > (CurrentPage * Constant.PageSize))) { CurrentPage = CurrentPage - 1; } // Get the Categorys categories = await _categoryService.GetCategoriesAsync(CurrentPage); // Close the Popup ShowPopup = false; } catch (Exception ex) { strError = ex.GetBaseException().Message; } }
public async Task GetUsers() { // clear any error messages strError = ""; ColUsers = await _userService.GetUsersAsync(strSearch, CurrentPage); }
protected async Task SaveCategory() { try { // A new Category will have the Id set to 0 if (SelectedCategory.CategoryId == 0) { // Create new Category CategoryDto objNewCategory = new CategoryDto(); objNewCategory.Name = SelectedCategory.Name; // Save the result var result = _categoryService.CreateCategoryAsync(objNewCategory); } else { var result = _categoryService.UpdateCategoryAsync(SelectedCategory); } // Get the Categorys categories = await _categoryService.GetCategoriesAsync(CurrentPage); // Close the Popup ShowPopup = false; } catch (Exception ex) { strError = ex.GetBaseException().Message; } }
protected async Task Previous() { if (CurrentPage > 1) { CurrentPage = CurrentPage - 1; logs = await LogService.GetLogsAsync(CurrentPage); } }
protected async Task Previous() { if (CurrentPage > 1) { CurrentPage = CurrentPage - 1; categories = await _categoryService.GetCategoriesAsync(CurrentPage); } }
protected override async Task OnInitializedAsync() { // Get the current user CurrentUser = (await authenticationStateTask).User; logs = await LogService.GetLogsAsync(CurrentPage); DisqusState.SetDisplayDisqus(false); }
protected async Task BlogUpdatedEvent() { using (new PerfTimerLogger("GetBlogsAsync", (CurrentUser.Identity.Name != null) ? CurrentUser.Identity.Name : "", LogService, httpContextAccessor)) { blogs = await _blogService.GetBlogsAsync(new BlogInputDto() { page = BlogSearchState.CurrentPage, CategoryId = Convert.ToInt32(BlogSearchState.CurrentCategoryID) }); } }
protected async Task Next() { CurrentPage = CurrentPage + 1; logs = await LogService.GetLogsAsync(CurrentPage); }
protected override async Task OnInitializedAsync() { categories = await _categoryService.GetCategoriesAsync(CurrentPage); }
protected async Task Next() { CurrentPage = CurrentPage + 1; categories = await _categoryService.GetCategoriesAsync(CurrentPage); }