//Set first responder arrival time
        private void FirstResponder_Click(object sender, RoutedEventArgs e)
        {
            TextBoxHandler.setNow(FirstResponderArrivalhh, FirstResponderArrivalmm);

            try
            {
                if (intervention.getCall911Time() != DateTime.MinValue)
                {
                    int      hh        = int.Parse(FirstResponderArrivalhh.Text);
                    int      mm        = int.Parse(FirstResponderArrivalmm.Text);
                    DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hh, mm, DateTime.Now.Second);
                    intervention.setFirstResponderArrivalTime(startTime);
                    int offset = (int)DateTime.Now.Subtract(startTime).TotalMinutes;
                    if (offset < 0)
                    {
                        MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_FutureTime);
                    }
                    intervention.ResourceModified();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_InvalidTime);
            }
        }
        //Set 911 call time
        private void Call_Click(object sender, RoutedEventArgs e)
        {
            TextBoxHandler.setNow(Call911hh, Call911mm);

            try
            {
                int      hh        = int.Parse(Call911hh.Text);
                int      mm        = int.Parse(Call911mm.Text);
                DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hh, mm, DateTime.Now.Second);
                intervention.setCall911Time(startTime);
                intervention.ResourceModified();
                int offset = (int)DateTime.Now.Subtract(startTime).TotalSeconds;
                if (offset < 0)
                {
                    MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_FutureTime);
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_InvalidTime);
            }
        }
示例#3
0
        //Called when the colon in the arrival column is clicked
        private void Arrival_Click(object sender, RoutedEventArgs e)
        {
            if (arrivalHHTextBox.Text.Equals("hh"))
            {
                TextBoxHandler.setNow(arrivalHHTextBox, arrivalMMTextBox);
            }

            try
            {
                int      hh      = int.Parse(arrivalHHTextBox.Text);
                int      mm      = int.Parse(arrivalMMTextBox.Text);
                DateTime endTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hh, mm, DateTime.Now.Second);
                int      offset  = (int)DateTime.Now.Subtract(endTime).TotalMinutes;
                if (offset < 0)
                {
                    MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_FutureTime);
                }
                else
                {
                    resource.setArrival(endTime);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ETD.Properties.Resources.MessageBox_Notification_InvalidTime);
            }

            resource.getTeam().setStatus("intervening");
        }
示例#4
0
        //Sets the current hours and minutes in the passed TextBoxes
        public void TimestampTime_Click(object sender, RoutedEventArgs e)
        {
            Button bt = (Button)sender;

            TextBoxHandler.setNow(timestampMap[bt.Name + rowNumber][0], timestampMap[bt.Name + rowNumber][1]);
            request.setTimeHH(timestampMap[bt.Name + rowNumber][0].Text.ToString());
            request.setTimeMM(timestampMap[bt.Name + rowNumber][1].Text.ToString());
        }
示例#5
0
        //Sets the current hours and minutes in the passed TextBoxes
        public void TimestampFollowUp_Click(object sender, RoutedEventArgs e)
        {
            Button bt = (Button)sender;

            TextBoxHandler.setNow(followupTimestampMap[bt.Name + rowNumber][0], followupTimestampMap[bt.Name + rowNumber][1]);
            request.setFollowUpHH(followupTimestampMap[bt.Name + rowNumber][0].Text.ToString());
            request.setFollowUpMM(followupTimestampMap[bt.Name + rowNumber][1].Text.ToString());
        }
示例#6
0
        //Sets the current hours and minutes in the passed TextBoxes
        public void TimeStampCompletion_Click(object sender, RoutedEventArgs e)
        {
            Button bt = (Button)sender;

            TextBoxHandler.setNow(completionTimestampMap[bt.Name + rowNumber][0], completionTimestampMap[bt.Name + rowNumber][1]);
            request.setCompletionHH(completionTimestampMap[bt.Name + rowNumber][0].Text.ToString());
            request.setCompletionMM(completionTimestampMap[bt.Name + rowNumber][1].Text.ToString());
        }
        //Called on additional info text box lost focus
        private void AdditionalInformation_GotFocus(object sender, RoutedEventArgs e)
        {
            TextBox tb = (TextBox)sender;

            if (tb.Text.Equals(""))
            {
                TextBoxHandler.setNow(timestampMap[equivalentKeyMap[tb.Name]][0], timestampMap[equivalentKeyMap[tb.Name]][1]);
            }
        }
 //Set conclusion time of an intervention
 private void End_Click(object sender, RoutedEventArgs e)
 {
     TextBoxHandler.setNow(Endhh, Endmm);
     try
     {
         int      hh       = int.Parse(Endhh.Text);
         int      mm       = int.Parse(Endmm.Text);
         DateTime concTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hh, mm, DateTime.Now.Second);
         intervention.setConclusionTime(concTime);
         intervention.ResourceModified();
     }
     catch { }
 }
        //Set up time to current time
        public void Timestamp_Click(object sender, RoutedEventArgs e)
        {
            Button bt = (Button)sender;

            TextBoxHandler.setNow(timestampMap[bt.Name][0], timestampMap[bt.Name][1]);
        }