Exemplo n.º 1
0
        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();
                }
            }
        }
Exemplo n.º 2
0
 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);
 }