Ejemplo n.º 1
0
 private void CreateNewRackButton_Click(object sender, RoutedEventArgs e)
 {
     if (IdTextBox.Text != "")
     {
         rack.Name = IdTextBox.Text;
         rack.ChooseGuid();
         rack.IsVacant = true;
         var thumb     = RackImageBox;
         var transform = thumb.RenderTransform as RotateTransform;
         rack.ImageRotation = transform.Angle;
         SQLDatabase.CreateRack(rack);
         CustomizeRacks customRack = new CustomizeRacks();
         this.NavigationService.Navigate(customRack);
     }
     else
     {
         string           messageBoxText = "All fields with red dot must be filled out to continue.";
         string           caption        = "Data Entry Warning";
         MessageBoxButton button         = MessageBoxButton.OK;
         MessageBoxImage  icon           = MessageBoxImage.Warning; //MessageBoxImage.YesNoCancel; -allows yes, no and cancel button to be displayed on dialog box
         MessageBox.Show(messageBoxText, caption, button, icon);
         //MessageBoxResult result = MessageBox.Show(messageBoxText, caption, button, icon);
         //switch (result)
         //{
         //    case MessageBoxResult.Yes:
         //        // User pressed Yes button
         //        // ...
         //        break;
         //    case MessageBoxResult.No:
         //        // User pressed No button
         //        // ...
         //        break;
         //    case MessageBoxResult.Cancel:
         //        // User pressed Cancel button
         //        // ...
         //        break;
         //}
     }
 }