private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите имя!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите фамилию!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите отчество!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(comboBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите команду!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(comboBox2.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите позицию игрока!");
         return(false);
     }
     return(true);
 }
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите название команды!");
         return(false);
     }
     return(true);
 }
 private void button3_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow.Cells[0].Value.ToString() != "1")
     {
         WorkWithBD.EditPrivilege(dataGridView1.CurrentRow.Cells[0].Value.ToString());
         dataGridView1.Rows.Clear();
         WorkWithBD.ReadUserForAdminFormForDataGirdView(dataGridView1);
     }
     else
     {
         WorkWithMessage.MessageBoxShow("Главного администратора нельзя изменить!");
     }
 }
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите название турнира!");
         return(false);
     }
     if (WorkWithBD.CheckTournament(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Такой турнир уже существует!");
         return(false);
     }
     return(true);
 }
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите название турнира!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(comboBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите победителя!");
         return(false);
     }
     return(true);
 }
Exemple #6
0
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(LoginTXTBox.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите логин!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(PasswordTXTBox.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите пароль!");
         return(false);
     }
     return(true);
 }
Exemple #7
0
 private void EnterBut_Click(object sender, EventArgs e)
 {
     if (Check())
     {
         if (WorkWithBD.CheckUser(LoginTXTBox.Text, PasswordTXTBox.Text))
         {
             WorkWithMessage.MessageBoxShow("Данный логин уже занят!");
             return;
         }
         else
         {
             WorkWithBD.AddUser(LoginTXTBox.Text, PasswordTXTBox.Text);
             this.Close();
         }
     }
 }
 private void button4_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow.Cells[0].Value.ToString() != "1")
     {
         if (MessageBox.Show("Вы уверены что хотите удалить данного пользователя?", "Сообщение", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             WorkWithBD.DeleteUser(dataGridView1.CurrentRow.Cells[0].Value.ToString());
             dataGridView1.Rows.Clear();
             WorkWithBD.ReadUserForAdminFormForDataGirdView(dataGridView1);
         }
     }
     else
     {
         WorkWithMessage.MessageBoxShow("Главного администратора нельзя удалить!");
     }
 }
Exemple #9
0
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(comboBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите команду №1");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(comboBox2.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите команду №2");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(comboBox3.Text))
     {
         WorkWithMessage.MessageBoxShow("Выберите турнир");
         return(false);
     }
     if (comboBox1.Text == comboBox2.Text)
     {
         WorkWithMessage.MessageBoxShow("Команды должны быть разными");
         return(false);
     }
     if (checkBox1.Checked)
     {
         if (numericUpDown1.Value == numericUpDown2.Value)
         {
             WorkWithMessage.MessageBoxShow("Счёт не может быть одинаковым!");
             return(false);
         }
         if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false)
         {
             WorkWithMessage.MessageBoxShow("Выберите в какой период закончился матч!");
             return(false);
         }
         if (radioButton2.Checked == true || radioButton3.Checked == true)
         {
             if (Math.Abs(numericUpDown1.Value - numericUpDown2.Value) != 1)
             {
                 WorkWithMessage.MessageBoxShow("Счёт должен отличаться на 1-у шайбу (т.к. победа была не в основное время)!");
                 return(false);
             }
         }
     }
     return(true);
 }
Exemple #10
0
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите имя!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox2.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите фамилию!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox3.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите отчество!");
         return(false);
     }
     return(true);
 }
Exemple #11
0
        private void EnterBut_Click(object sender, EventArgs e)
        {
            if (WorkWithBD.CheckUser(LoginTXTBox.Text, PasswordTXTBox.Text))
            {
                switch (WorkWithBD.GetNamePrivilegeForLoginPrivelege(LoginTXTBox.Text))
                {
                case "Admin":
                {
                    this.Visible = false;
                    AdminForm form = new AdminForm(LoginTXTBox.Text);
                    LoginTXTBox.Text    = string.Empty;
                    PasswordTXTBox.Text = string.Empty;
                    form.ShowDialog();
                    this.Visible = true;
                    break;
                }

                case "User":
                {
                    this.Visible = false;
                    UserForm form = new UserForm(LoginTXTBox.Text);
                    LoginTXTBox.Text    = string.Empty;
                    PasswordTXTBox.Text = string.Empty;
                    form.ShowDialog();
                    this.Visible = true;
                    break;
                }

                default:
                {
                    WorkWithMessage.MessageBoxShow("Привилегия пользователя непоределена!");
                    break;
                }
                }
            }
            else
            {
                WorkWithMessage.MessageBoxShow("Неверный логин и пароль!");
            }
        }
Exemple #12
0
 private bool Check()
 {
     if (String.IsNullOrWhiteSpace(textBox1.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите имя!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox2.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите фамилию!");
         return(false);
     }
     if (String.IsNullOrWhiteSpace(textBox2.Text))
     {
         WorkWithMessage.MessageBoxShow("Введите отчество!");
         return(false);
     }
     if (dateTimePicker1.Value > DateTime.Now)
     {
         WorkWithMessage.MessageBoxShow("Неправильная дата рождения!");
         return(false);
     }
     return(true);
 }
Exemple #13
0
 private void Enter_Load(object sender, EventArgs e)
 {
     WorkWithMessage.MessageBoxShow("Для входа под правами администратора введите: \n Логин: admin \n Пароль: admin");
 }