Пример #1
0
 private void EditStandardBooking()
 {
     if (listBookings.SelectedItems.Count == 1)
     {
         Booking            booking             = (Booking)listBookings.SelectedItems[0].Tag;
         AddStandardBooking editStandardBooking = new AddStandardBooking {
             StandardBooking = booking
         };
         while (editStandardBooking.ShowDialog(this) == DialogResult.OK)
         {
             try
             {
                 var modifiedBooking = editStandardBooking.StandardBooking;
                 modifiedBooking.Id = booking.Id;
                 standardBookingServices.UpdateStandardBookings(modifiedBooking);
                 LoadBookings();
                 string message = GetString("ChangesSaved");
                 string caption = GetString("Message");
                 MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 break;
             }
             catch (Exception e)
             {
                 editStandardBooking.Show(this);
                 new frmShowError(CustomExceptionHandler.ShowExceptionText(e)).ShowDialog();
                 editStandardBooking.Hide();
             }
         }
     }
 }
Пример #2
0
 private void AddStandardBooking()
 {
     AddStandardBooking addStandardBooking = new AddStandardBooking();
     while (addStandardBooking.ShowDialog(this) == DialogResult.OK)
     {
         try
         {
             standardBookingServices.CreateStandardBooking(addStandardBooking.StandardBooking);
             LoadBookings();
             string message = GetString("Created");
             string caption = GetString("Message");
             MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
             break;
         }
         catch (Exception e)
         {
             addStandardBooking.Show(this);
             new frmShowError(CustomExceptionHandler.ShowExceptionText(e)).ShowDialog();
             addStandardBooking.Hide();
         }
     }
 }
Пример #3
0
        private void AddStandardBooking()
        {
            AddStandardBooking addStandardBooking = new AddStandardBooking();

            while (addStandardBooking.ShowDialog(this) == DialogResult.OK)
            {
                try
                {
                    standardBookingServices.CreateStandardBooking(addStandardBooking.StandardBooking);
                    LoadBookings();
                    string message = GetString("Created");
                    string caption = GetString("Message");
                    MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;
                }
                catch (Exception e)
                {
                    addStandardBooking.Show(this);
                    new frmShowError(CustomExceptionHandler.ShowExceptionText(e)).ShowDialog();
                    addStandardBooking.Hide();
                }
            }
        }
Пример #4
0
 private void EditStandardBooking()
 {
     if (listBookings.SelectedItems.Count == 1)
     {
         Booking booking = (Booking)listBookings.SelectedItems[0].Tag;
         AddStandardBooking editStandardBooking = new AddStandardBooking { StandardBooking = booking };
         while (editStandardBooking.ShowDialog(this) == DialogResult.OK)
         {
             try
             {
                 var modifiedBooking = editStandardBooking.StandardBooking;
                 modifiedBooking.Id = booking.Id;
                 standardBookingServices.UpdateStandardBookings(modifiedBooking);
                 LoadBookings();
                 string message = GetString("ChangesSaved");
                 string caption = GetString("Message");
                 MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 break;
             }
             catch (Exception e)
             {
                 editStandardBooking.Show(this);
                 new frmShowError(CustomExceptionHandler.ShowExceptionText(e)).ShowDialog();
                 editStandardBooking.Hide();
             }
         }
     }
 }