Example #1
0
 //Setup initial form
 private void FillForm(Intervention intervention)
 {
     if (intervention.getCallerName() != null)
     {
         CallerName.Text = intervention.getCallerName();
     }
     if (intervention.getLocation() != null)
     {
         Location.Text = intervention.getLocation();
     }
     if (intervention.getNatureOfCall() != null)
     {
         NatureOfCall.Text = intervention.getNatureOfCall();
     }
     if (intervention.getAge() != null)
     {
         Age.Text = intervention.getAge();
     }
     if (intervention.getCode() != 0)
     {
         Priority.SelectedIndex = intervention.getCode() - 1;
     }
     if (intervention.getGender() != null)
     {
         int index = -1;
         foreach (ComboBoxItem cb in Gender.Items)
         {
             index++;
             if (cb.Content.ToString() == intervention.getGender())
             {
                 break;
             }
         }
         Gender.SelectedIndex = index;
     }
     if (intervention.getChiefComplaint() != null)
     {
         int index = -1;
         foreach (ComboBoxItem cb in Complaint.Items)
         {
             index++;
             if (cb.Content.ToString() == intervention.getChiefComplaint())
             {
                 break;
             }
         }
         Complaint.SelectedIndex = index;
     }
     if (intervention.getTimeOfCall() != null)
     {
         TextBoxHandler.setTime(Callhh, Callmm, intervention.getTimeOfCall().Hour, intervention.getTimeOfCall().Minute);
     }
 }
        //Setup initial form
        private void FillForm(Intervention intervention)
        {
            AdditionalInformation.Text = intervention.getConclusionAdditionalInfo();

            if (intervention.getConclusion() != null)
            {
                int index = 0;
                foreach (ComboBoxItem cb in ConclusionBox.Items)
                {
                    index++;
                    if (cb.Content.ToString() == intervention.getConclusion())
                    {
                        break;
                    }
                }
                ConclusionBox.SelectedIndex = index - 1;
            }

            if (intervention.getConclusionTime().Hour != 0 && intervention.getConclusionTime().Minute != 0)
            {
                TextBoxHandler.setTime(Endhh, Endmm, intervention.getConclusionTime().Hour, intervention.getConclusionTime().Minute);
            }
            if (intervention.getConclusion() == Properties.Resources.ComboBoxItem_Conclusion_911)
            {
                if (intervention.getCall911Time().Hour != 0 && intervention.getCall911Time().Minute != 0)
                {
                    TextBoxHandler.setTime(Call911hh, Call911mm, intervention.getCall911Time().Hour, intervention.getCall911Time().Minute);
                }
                if (intervention.getFirstResponderArrivalTime().Hour != 0 && intervention.getFirstResponderArrivalTime().Minute != 0)
                {
                    TextBoxHandler.setTime(FirstResponderArrivalhh, FirstResponderArrivalmm, intervention.getFirstResponderArrivalTime().Hour, intervention.getFirstResponderArrivalTime().Minute);
                }

                if (intervention.getAmbulanceArrivalTime().Hour != 0 && intervention.getAmbulanceArrivalTime().Minute != 0)
                {
                    TextBoxHandler.setTime(AmbulanceArrivalhh, AmbulanceArrivalmm, intervention.getAmbulanceArrivalTime().Hour, intervention.getAmbulanceArrivalTime().Minute);
                }

                AmbulanceCompany.Text      = intervention.getAmbulanceCompany();
                AmbulanceVehicle.Text      = intervention.getAmbulanceVehicle();
                FirstResponderCompany.Text = intervention.getFirstResponderCompany();
                FirstResponderVehicle.Text = intervention.getFirstResponderVehicle();
                MeetingPoint.Text          = intervention.getMeetingPoint();
            }
        }