Exemplo n.º 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.");
     }
 }
Exemplo n.º 2
0
        public void AddEmpTickTest()
        {
            int emp  = 1007;
            int tick = 1008;

            Help.AddEmpTick(emp, tick);
        }