Пример #1
0
 private void EditRackButton_Click(object sender, RoutedEventArgs e)
 {
     rack.Name = IdTextBox.Text;
     if (SQLDatabase.UpdateRack(rack))
     {
         SQLDatabase.UpdateRack(rack);
         CustomizeRacks customizeRacks = new CustomizeRacks();
         this.NavigationService.Navigate(customizeRacks);
     }
     else
     {
         MessageBox.Show("Error");
     }
 }
Пример #2
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;
         //}
     }
 }
Пример #3
0
        private void CustomizeRacks_Click(object sender, RoutedEventArgs e)
        {
            CustomizeRacks customizeRacks = new CustomizeRacks();

            this.NavigationService.Navigate(customizeRacks);
        }