예제 #1
0
        private async Task LoadAsync()
        {
            var input = new GetPagedGigsRequest
            {
                Filter     = Keyword,
                CategoryId = Category?.Id
            };
            var results = await GigAppService.GetListAsync(input);

            GigList    = results.Items.Where(x => x.IsPublished).ToList();
            TotalCount = results.TotalCount;
        }
예제 #2
0
        private async Task DeleteProductAsync(GigDto gig)
        {
            var confirmMessage = L["GigDeletionConfirmationMessage", gig.Title];

            if (!await Message.Confirm(confirmMessage))
            {
                return;
            }

            await GigAppService.DeleteAsync(gig.Id);

            await GetProductsAsync();
        }
예제 #3
0
        private async Task GetProductsAsync()
        {
            var result = await GigAppService.GetListAsync(
                new GetPagedGigsRequest()
            {
                MaxResultCount = PageSize,
                SkipCount      = CurrentPage *PageSize,
                Sorting        = CurrentSorting
            }
                );

            GigList    = result.Items;
            TotalCount = (int)result.TotalCount;
        }
예제 #4
0
        protected override async Task OnInitializedAsync()
        {
            var input = new GetPagedGigsRequest()
            {
                MaxResultCount = 3,
                Sorting        = "CreationTime asc"
            };

            var results = await GigAppService.GetListAsync(input);

            GigList = results.Items;

            await base.OnInitializedAsync();
        }
예제 #5
0
        private async Task HandlePublish(GigDto gig)
        {
            GigDto resultGig = null;

            if (gig.IsPublished)
            {
                resultGig = await GigAppService.UnpublishAsync(gig.Id);
            }
            else
            {
                resultGig = await GigAppService.PublishAsync(gig.Id);
            }

            var message = resultGig.IsPublished ? "Published " : "UnPublished";
            await Message.Success($"Product successfully {message}");

            await GetProductsAsync();
        }