private async Task ReplenishAllItems() { var replenishmentModel = ReplenishmentBuilder.BuildReplenishmentDto(this.FirstReplenishmentDate, this.SecondReplenishmentDate, this.ReplenishmentItems); await this.ReplenishmentService.ReplenishItems(replenishmentModel); NavigateToAllItems(); }
private async Task ReplenishItem(int itemId) { var viewModel = this.ReplenishmentItems.FirstOrDefault(x => x.ItemId == itemId); var replenishmentModel = ReplenishmentBuilder.BuildReplenishmentDto(this.FirstReplenishmentDate, this.SecondReplenishmentDate, viewModel); await this.ReplenishmentService.ReplenishItems(replenishmentModel); var response = await ReplenishmentService.GetShoppingListItems(this.FirstReplenishmentDate, this.SecondReplenishmentDate); if (!response.IsSuccess) { this.Error.Show(response.ErrorMessage); } if (response.Data != null) { this.ReplenishmentItems = response.Data.Select(x => Mapper.Map <ReplenishmentItemDto, PurchaseItemViewModel>(x)).ToList(); } }