private void Confirm_SIREmail_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateSIREmail())
            {
                string currentID = id.Text; // Gets id from textbox.
                if (currentID.Length < 9)
                {
                    // Forces message ID to be 9 characters.
                    string zeros = String.Concat(Enumerable.Repeat("0", 9 - currentID.Length));
                    currentID = zeros + currentID;
                }

                currentID = "E" + currentID; // Makes sure E is added to the message ID for email type.

                // Collects incident type from drop down menu.
                ComboBoxItem cmb         = (ComboBoxItem)incidentTypeCombo.SelectedItem;
                string       subject     = "SIR " + System.DateTime.Now.ToString("dd/MM/yy");
                string       messageBody = "Cent Code: " + centerCode1.Text + "-" + centerCode2.Text + "-" + centerCode3.Text + " " + "Nature of Incident: " + cmb.Content + " " + messageTextbox.Text;

                subject += String.Concat(Enumerable.Repeat(" ", 20 - subject.Length));

                // Creates SIR email objects to be used later.
                SIR sir = new SIR(currentID + " " + emailTextbox.Text + " " + subject + messageBody);
                MessageHolder.currentEmailID++;
                MessageHolder.AddMessage(currentID, sir);

                // Confirmation message for user.
                MessageBox.Show("SIR Email Added!\n" + "Message ID: " + currentID + "\nEmail: " + emailTextbox.Text + "\nSubject: " + subject + "\nIncident: " + cmb.Content + "\nMessage: " + messageTextbox.Text);
            }
        }
Beispiel #2
0
        private void Confirm_Tweet_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateTweet())
            {
                string currentID = id.Text; // Gets id from textbox.
                if (currentID.Length < 9)
                {
                    // Forces message ID to be 9 characters.
                    string zeros = String.Concat(Enumerable.Repeat("0", 9 - currentID.Length));
                    currentID = zeros + currentID;
                }
                currentID = "T" + currentID; // Makes sure E is added to the message ID for email type.

                // Creates Tweet objects to be used later.
                Tweet tweet = new Tweet(currentID + " " + twitterHandle.Text + " " + twitterMessage.Text);
                MessageHolder.currentTwitterID++;
                MessageHolder.AddMessage(currentID, tweet);

                // Confirmation message for user.
                MessageBox.Show("Tweet Added!\n" + "Message ID: " + currentID + "\nHandle: " + twitterHandle.Text + "\nMessage: " + twitterMessage.Text);
            }
        }
Beispiel #3
0
        private void Confirm_SMS_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateSMS())
            {
                string currentID = id.Text; // Gets id from textbox.
                // Forces message ID to be 9 characters.
                if (currentID.Length < 9)
                {
                    string zeros = String.Concat(Enumerable.Repeat("0", 9 - currentID.Length));
                    currentID = zeros + currentID;
                }
                currentID = "S" + currentID; // Makes sure S is added to the message ID for SMS type.

                // Creates SMS objects to be used later.
                SMS sms = new SMS(currentID + " " + phoneNoTextbox.Text + " " + messageTextbox.Text);
                MessageHolder.currentSMSID++;
                MessageHolder.AddMessage(currentID, sms);

                // Confirmation message for user.
                MessageBox.Show("SMS Added!\n" + "Message ID: " + currentID + "\nPhone No.: " + phoneNoTextbox.Text + "\nMessage: " + messageTextbox.Text);
            }
        }
        private void Confirm_Email_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateEmail())
            {
                string currentID = id.Text; // Gets id from textbox.
                if (currentID.Length < 9)
                {
                    // Forces message ID to be 9 characters.
                    string zeros = String.Concat(Enumerable.Repeat("0", 9 - currentID.Length));
                    currentID = zeros + currentID;
                }

                currentID = "E" + currentID; // Makes sure E is added to the message ID for email type.

                // Creates email objects to be used later.
                Email email = new Email(currentID + " " + emailTextbox.Text + " " + subjectTextbox.Text + " " + messageTextbox.Text);
                MessageHolder.currentEmailID++;
                MessageHolder.AddMessage(currentID, email);

                // Confirmation message for user.
                MessageBox.Show("Email Added!\n" + "Message ID: " + currentID + "\nEmail: " + emailTextbox.Text + "\nSubject: " + subjectTextbox.Text + "\nMessage: " + messageTextbox.Text);
            }
        }