Beispiel #1
0
        private async void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            popup        = ConfigurePopup.Configure(popup, "Fill all the fields first!", BtnConfirm, PlacementMode.Top);
            popup.IsOpen = false;
            texts        = ListTextBoxesHelper.GetText(SP.Children);
            if (ListTextBoxesHelper.StringsNotEmpty(texts))
            {
                try
                {
                    if (!DecimalNumberChecker.Check(texts[1]))
                    {
                        popup        = ConfigurePopup.Configure(popup, "Only decimal numbers in price are allowed in price field!", BtnConfirm, PlacementMode.Top);
                        popup.IsOpen = true;
                        return;
                    }
                    await Task.Run(() => AdminInterface.UpdateAsync(Attraction.Id, Attraction));

                    this.Close();
                }
                catch (Exception ex)
                {
                    popup        = ConfigurePopup.Configure(popup, ex.Message, BtnConfirm, PlacementMode.Top);
                    popup.IsOpen = true;
                }
            }
            else
            {
                popup.IsOpen = true;
            }
        }
Beispiel #2
0
 private void BtnConfirm_Click(object sender, RoutedEventArgs e)
 {
     popup.IsOpen = false;
     texts        = ListTextBoxesHelper.GetText(SP.Children);
     if (ListTextBoxesHelper.StringsNotEmpty(texts))
     {
         if (!DecimalNumberChecker.Check(texts[1]))
         {
             popup        = ConfigurePopup.Configure(popup, "Only decimal numbers in price are allowed in price field!", BtnConfirm, PlacementMode.Top);
             popup.IsOpen = true;
             return;
         }
         AdminInterface.Add(Attraction);
         this.Close();
     }
     else
     {
         popup.IsOpen = true;
     }
 }