Ejemplo n.º 1
0
        public static string ValidateMessageId(string messageIdPref, string messageId)
        {
            if (int.TryParse(messageId, out var messageIdNumber))
            {
                if (String.IsNullOrWhiteSpace(messageIdPref) || messageId.Length != 9)
                {
                    MessageBox.Show("Select Message Id type and input 9-digit number", "Input Error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    switch (messageIdPref)
                    {
                    case "S":
                        SMSWindow smsWindow = new SMSWindow();
                        smsWindow.MessageId_textBox.Text = messageIdPref + messageIdNumber.ToString();
                        smsWindow.ShowDialog();
                        break;

                    case "E":
                        EmailWindow emailWindow = new EmailWindow();
                        // Passing MessageId to new window textbox
                        emailWindow.MessageId_textBox.Text = messageIdPref + messageIdNumber.ToString();
                        emailWindow.ShowDialog();
                        break;

                    case "T":
                        TwitterWindow twitterWindow = new TwitterWindow();
                        twitterWindow.MessageId_textBox.Text = messageIdPref + messageIdNumber.ToString();
                        twitterWindow.ShowDialog();
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("MessageId needs to be numeric", "Input Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }

            return(messageIdPref + messageIdNumber.ToString());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Twitter連携画面オープン
 /// </summary>
 public void OpenTwitterWindow()
 {
     try
     {
         TwitterWindow win = new TwitterWindow(MainService == null ? false : true);
         win.ShowDialog();
         if (MainService != null)
         {
             TwitterAuth = Visibility.Visible;
         }
         else
         {
             TwitterAuth = Visibility.Hidden;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ClsConst.ErrorMessage);
         ClsLogWrite.LogWrite(ex.Message, ex);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Twitter連携画面オープン
 /// </summary>
 public void OpenTwitterWindow()
 {
     try
     {
         TwitterWindow win = new TwitterWindow(MainService == null ? false : true);
         win.ShowDialog();
         if (MainService != null)
             TwitterAuth = Visibility.Visible;
         else
             TwitterAuth = Visibility.Hidden;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ClsConst.ErrorMessage);
         ClsLogWrite.LogWrite(ex.Message, ex);
     }
 }