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

                return;
            }
        }
示例#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();
        }
示例#3
0
 public void HideDeleteCookbookDialog()
 {
     RestoreInitialState();
     cookbookDto = new CookbookDto();
 }
示例#4
0
 public void ShowHideDeleteCookbookDialog(CookbookDto cookbook)
 {
     CookbookIdToBeDeleted = cookbook.CookbookId;
     TargetedCookbook      = cookbook.Name;
     DeleteCookbookButtonClicked();
 }