Exemple #1
0
        public async void DeleteCookbookButtonClicked(CookbookDto cookbook)
        {
            if (cookbook.Name == TargetedCookbook)
            {
                RestoreInitialState();
                cookbook.CookbookId = CookbookIdToBeDeleted;
                await DeleteCookbook(cookbook);

                return;
            }
        }
Exemple #2
0
        private async Task DeleteCookbook(CookbookDto cookbook)
        {
            string apiName  = string.Format($"api/Cookbooks/{cookbook.CookbookId}");
            var    response = await Http.DeleteAsync(apiName);

            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine("Successfully deleted cookbook: " + cookbook.Name + " (" + cookbook.CookbookId + ")");
                await OnInitializedAsync();
            }
            HideDeleteCookbookDialog();
        }
Exemple #3
0
 public void HideDeleteCookbookDialog()
 {
     RestoreInitialState();
     cookbookDto = new CookbookDto();
 }
Exemple #4
0
 public void ShowHideDeleteCookbookDialog(CookbookDto cookbook)
 {
     CookbookIdToBeDeleted = cookbook.CookbookId;
     TargetedCookbook      = cookbook.Name;
     DeleteCookbookButtonClicked();
 }