Пример #1
0
        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;
            }
        }
Пример #2
0
        public async Task GetUsers()
        {
            // clear any error messages
            strError = "";

            ColUsers = await _userService.GetUsersAsync(strSearch, CurrentPage);
        }
Пример #3
0
        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;
            }
        }
Пример #4
0
 protected async Task Previous()
 {
     if (CurrentPage > 1)
     {
         CurrentPage = CurrentPage - 1;
         logs        = await LogService.GetLogsAsync(CurrentPage);
     }
 }
Пример #5
0
 protected async Task Previous()
 {
     if (CurrentPage > 1)
     {
         CurrentPage = CurrentPage - 1;
         categories  = await _categoryService.GetCategoriesAsync(CurrentPage);
     }
 }
Пример #6
0
        protected override async Task OnInitializedAsync()
        {
            // Get the current user
            CurrentUser = (await authenticationStateTask).User;

            logs = await LogService.GetLogsAsync(CurrentPage);

            DisqusState.SetDisplayDisqus(false);
        }
Пример #7
0
 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)
         });
     }
 }
Пример #8
0
 protected async Task Next()
 {
     CurrentPage = CurrentPage + 1;
     logs        = await LogService.GetLogsAsync(CurrentPage);
 }
Пример #9
0
 protected override async Task OnInitializedAsync()
 {
     categories = await _categoryService.GetCategoriesAsync(CurrentPage);
 }
Пример #10
0
 protected async Task Next()
 {
     CurrentPage = CurrentPage + 1;
     categories  = await _categoryService.GetCategoriesAsync(CurrentPage);
 }