private void btnAdd_Click(object sender, EventArgs e) { if (cboCustomer.Text.ToString().Trim() != "") { string title = txtTickTitle.Text.ToString(); string description = txtTickDescription.Text.ToString(); int severity = (int)numSeverity.Value; bool complete = ckbTickComplete.Checked; string fix = txtFixDescription.Text.ToString(); help.AddTicket(title, description, severity, complete, fix); //Gets an internal list of tickets to make it possible get the ID of the new ticket. List <int> tickets = new List <int>(); tickets = help.GetTickets(); //Gets customerID to add to the custtick table. var cust = help.GetCustomer(cboCustomer.Text.ToString()); int lastID = tickets.Last(); help.AddCustTick(cust.Item1, lastID); if (cboUserName.Text.ToString().Trim() != "") { var emp = help.GetEmployee(cboUserName.Text.ToString()); help.AddEmpTick(emp.Item1, lastID); } PopulateAll(); } else { MessageBox.Show("Requires a customer name."); } }
public void AddTicketTest() { string pT = "No Longer Updates"; string pD = "Stupid computer quit updating"; int tS = 5; bool tC = false; string tFD = ""; Help.AddTicket(pT, pD, tS, tC, tFD); }