private void createIncidentButton_Click(object sender, EventArgs e)
        {
            if (titleBox.Text == "")
            {
               MessageBox.Show("Title cannot be blank.");

            }

            else if (descriptionBox.Text == "") {
                MessageBox.Show("Description Cannot be blank.");
               }

            else {
                incident = new Incident();
                this.PutIncidentData(incident);

                try
                {
                    incCont.AddIncidents(incident);
                    MessageBox.Show("Incident Added");
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, ex.GetType().ToString());
                    this.BeginInvoke(new MethodInvoker(Close));

                }
                finally
                {
                    this.Close();
                }
            }
        }
 private void PutIncidentData(Incident incident)
 {
     incident.CustomerID = (int)customerNameBox.SelectedValue;
     incident.ProductCode = productNameBox.SelectedValue.ToString() ;
     incident.Title = titleBox.Text;
     incident.Description = descriptionBox.Text;
 }
 public void CloseIncident(Incident inc)
 {
     IncidentDAL.CloseIncident(inc);
 }
 public void UpdateIncidents(Incident oldInc, Incident newInc)
 {
     IncidentDAL.UpdateIncident(oldInc, newInc);
 }
 /// <summary>
 /// Adds an Incident to the Incident database
 /// </summary>
 /// <param name="inc">inc the incident object to be added to the database</param>
 public void AddIncidents(Incident inc)
 {
     IncidentDAL.AddIncident(inc);
 }