Esempio n. 1
0
        private void CreateTicketWithUserBttn_Click(object sender, EventArgs e)
        {
            int selectedIndex = ResultGrid.CurrentCell.RowIndex;

            int ticketId = Convert.ToInt32(ResultGrid.Rows[selectedIndex].Cells["TicketIdCol"].Value);
            try
            {
                TicketRepository ticketRepo = new TicketRepository();
                TicketResource ticketRes = ticketRepo.GetCustomerInfoBasedOnTicketId(ticketId);

                AlterationForm alterationForm = new AlterationForm(ticketRes);
                alterationForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show("There was an error. Please contact Jay with this message: " + ex.Message);
            }
            //TODO ask neil which behavior he prefers
            //EnableButtonsBasedOnGrid();
            this.Close();
        }
Esempio n. 2
0
 private void NewTicketWithCustomerBttn_Click(object sender, EventArgs e)
 {
     if (ticketID == 0)
     {
         MessageBox.Show("You need to save this ticket before you can create a new ticket with this customer!");
         return;
     }
     CustomerRepository repo = new CustomerRepository();
     CustomerResource resource = repo.getCustomerById(customerId);
     AlterationForm form = new AlterationForm(resource);
     form.Show();
 }
Esempio n. 3
0
        private void OpenTicketButton_Click(object sender, EventArgs e)
        {
            int selectedIndex = ResultGrid.CurrentCell.RowIndex;

            int ticketId = Convert.ToInt32(ResultGrid.Rows[selectedIndex].Cells["TicketIdCol"].Value);
            try
            {
                TicketRepository ticketRepo = new TicketRepository();
                TicketResource ticketRes = ticketRepo.GetTicketByTicketID(ticketId);

                TicketAlterationRepository alterationRepo = new TicketAlterationRepository();
                TicketAlterationResource alterationRes = alterationRepo.GetAlterationsByTicketId(ticketId);

                AlterationForm alterationForm = new AlterationForm(ticketRes, alterationRes);
                alterationForm.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show("There was an error. Please contact Jay with this message: " + ex.Message);
            }

            //TODO get Neil's feedback on what behavior he prefers
            //this.Close();
        }