예제 #1
0
 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.");
     }
 }
예제 #2
0
        public void AddCustTickTest()
        {
            int cust = 1008;
            int tick = 1008;

            Help.AddCustTick(cust, tick);
        }