Esempio n. 1
0
        public static void WriteEmail(FormatMessage formatMessage)
        {
            JObject text;

            if (formatMessage.IsSIR)
            {
                text = new JObject(
                    new JProperty("ID", formatMessage.MessageID),
                    new JProperty("sender", formatMessage.GarbageRemoval(formatMessage.MessageText[0])),
                    new JProperty("subject", formatMessage.GarbageRemoval(formatMessage.MessageText[1])),
                    new JProperty("code", formatMessage.GarbageRemoval(formatMessage.MessageText[2])),
                    new JProperty("Nature of Incident", formatMessage.GarbageRemoval(formatMessage.MessageText[3])),
                    new JProperty("text", formatMessage.EmailBody));
            }
            else
            {
                text = new JObject(
                    new JProperty("ID", formatMessage.MessageID),
                    new JProperty("sender", formatMessage.GarbageRemoval(formatMessage.MessageText[0])),
                    new JProperty("subject", formatMessage.GarbageRemoval(formatMessage.MessageText[1])),
                    new JProperty("text", formatMessage.EmailBody));
            }

            File.WriteAllText(@"C:\Users\40203\" + formatMessage.MessageID + ".json", text.ToString());
        }
Esempio n. 2
0
        public static void Write(Message message, FormatMessage formatMessage, ShowMessage showMessage)
        {
            JObject text = new JObject(
                new JProperty("ID", formatMessage.MessageID),
                new JProperty("sender", formatMessage.GarbageRemoval(formatMessage.MessageText[0])),
                new JProperty("text", showMessage.TextSpeak(formatMessage.FormatBody(message.Body.text, 1))));

            File.WriteAllText(@"C:\Users\40203\" + formatMessage.MessageID + ".json", text.ToString());
        }
Esempio n. 3
0
        private void addMessagebtn_Click(object sender, RoutedEventArgs e)
        {
            String ID = "";

            if (String.IsNullOrWhiteSpace(messageIDtbx.Text.ToString()))
            {
                ID = lines[0];
                Console.WriteLine(lines[0]);
                lines = lines.Skip(1).ToArray();
            }
            else
            {
                ID = messageIDtbx.Text;
                for (int i = 0; i < inputMessagetbx.LineCount; i++)
                {
                    lines[i] = inputMessagetbx.GetLineText(i);
                }
            }

            FormatMessage fm = null;

            if (!String.IsNullOrEmpty(inputMessagetbx.Text))
            {
                try
                {
                    fm = new FormatMessage(ID, lines);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
            else
            {
                MessageBox.Show("no input within textbox");
                return;
            }
            ShowMessage sm = new ShowMessage(fm);

            sm.ShowDialog();
        }