コード例 #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();
                }
            }
        }
コード例 #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;
 }
コード例 #3
0
 public void CloseIncident(Incident inc)
 {
     IncidentDAL.CloseIncident(inc);
 }
コード例 #4
0
 public void UpdateIncidents(Incident oldInc, Incident newInc)
 {
     IncidentDAL.UpdateIncident(oldInc, newInc);
 }
コード例 #5
0
 /// <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);
 }