Beispiel #1
0
        private bool _verifyInput()
        {
            if (TextBoxFrom.Text.Length == 0)
            {
                MessageBox.Show("Please input From, the format can be [email protected] or Tester<*****@*****.**>");
                TextBoxFrom.Focus();
                return(false);
            }

            if (ListViewTo.Items.Count == 0)
            {
                MessageBox.Show("Please add a recipient at least!");
                ButtonAddRecipient.Focus();
                return(false);
            }

            if (CheckBoxAuth.Checked &&
                (TextBoxUser.Text.Length == 0 || TextBoxPassword.Text.Length == 0))
            {
                MessageBox.Show("Please input user/password for authentication!");
                TextBoxUser.Focus();
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 private void Refresh()
 {
     //Очищаю DataGrid критериев и проектов
     DataGridCtg.DataContext = null;
     DataGridPrj.DataContext = null;
     DataGridCsh.DataContext = null;
     //Заполняю основную таблицу
     _csh = new Csh();
     _csh.Fill(DataGridCsh);
     ButtonAdd.Content = "Добавить";
     //Заполняю критерии
     _ctg = new Ctg(DataGridCtg, TextBoxFrom);
     _prj = new Prj(_ctg);
     _stt = new Stt(_ctg);
     //Обнуляем переменные и сумму
     ButtonAdd.IsEnabled = false;
     TextBoxSum.Text     = "0.00";
     TextBoxComment.Text = "";
     DateCsh.Text        = DateTime.Now.ToString(CultureInfo.CurrentCulture);
     TextBoxTo.Text      = "Куда";
     TextBoxFrom.Text    = "Откуда";
     TextBoxSumFrom.Text = "";
     TextBoxSumTo.Text   = "";
     TextBoxFrom.Focus();
 }