Beispiel #1
0
        //@return true if successful save
        private Boolean InsertAlterationIntoDatabase()
        {
            try
            {
                TicketResource ticketResource = CollectFormDataForTicketResource();
                TicketRepository ticketRepo = new TicketRepository();
                ticketID = ticketRepo.InsertNewTicket(ticketResource);

                TicketAlterationResource alterationResource = CollectAlterationGridDataForAlterationResource();
                TicketAlterationRepository alterationRepo = new TicketAlterationRepository();
                alterationRepo.InsertAlterations(alterationResource);

                TicketNumberLabel.Text = ticketID.ToString();
                TicketNumberLabel.Show();
                MessageBox.Show("Your alteration was successfully saved. The ticket ID is " + ticketID.ToString());
                isNewAlteration = false;
                NewTicketWithCustomerBttn.Enabled = true;

                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("There was an error saving to the database. Please contact Jay with this message: " + ex.Message);
                return false;
            }
        }