Beispiel #1
0
 internal static NewIncidentManagerForm GetNewIncidentForm()
 {
     if (newIncidentManagerForm == null)
     {
         newIncidentManagerForm = new NewIncidentManagerForm();
         return(newIncidentManagerForm);
     }
     else
     {
         return(newIncidentManagerForm);
     }
 }
        private void ShowCreateUpdateIncidenceScreen(bool edit, Incidence incidence = null)
        {
            this.Hide();
            NewIncidentManagerForm newIncidentForm = FormBuilder.GetNewIncidentForm();

            if (edit == true)
            {
                newIncidentForm.descriptionTextBox.Text = incidence.Comments;
                newIncidentForm.levelCb.Text            = incidence.Level;
                newIncidentForm.areaCb.Text             = incidence.Area;
                newIncidentForm.stateCb.Text            = incidence.State;
                newIncidentForm.stateCb.Visible         = true;
                newIncidentForm.stateLabel.Visible      = true;
            }
            else
            {
                newIncidentForm.descriptionTextBox.Text = "";
                newIncidentForm.levelCb.SelectedIndex   = 0;
                newIncidentForm.areaCb.SelectedIndex    = 0;
                newIncidentForm.stateCb.Visible         = false;
                newIncidentForm.stateCb.Visible         = false;
            }
            newIncidentForm.Show();
        }