private void button3_Click(object sender, EventArgs e)
        {
            ActiveForm.Hide();
            RegEventForm reg = new RegEventForm(runnerId);

            reg.ShowDialog();
            Close();
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int year = DateTime.Now.Year - dateTimePicker1.Value.Year;

            bool psCheck = passCheck(textBox2.Text);
            bool emCheck = validateEmail(textBox1.Text);

            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || comboBox1.Text == "" || comboBox2.Text == "" || textBox7.Text == "")
            {
                MessageBox.Show("Не все поля заполнены!");
            }
            else
            {
                if (year >= 10)
                {
                    if (emCheck)
                    {
                        if (psCheck)
                        {
                            MessageBox.Show("True");
                            if (textBox2.Text == textBox3.Text)
                            {
                                SqlConnClass scc = new SqlConnClass();
                                string       dt  = dateTimePicker1.Value.ToString("yyyy-MM-dd hh:mm:ss");
                                scc.RegRunnrAdd(textBox1.Text, textBox4.Text, textBox5.Text, textBox2.Text, comboBox1.Text, dt, comboBox2.Text, textBox7.Text);
                                ActiveForm.Hide();
                                int          id = scc.GetRuddenrId(textBox1.Text);
                                RegEventForm rf = new RegEventForm(id);
                                rf.ShowDialog();
                                Close();
                            }
                            else
                            {
                                MessageBox.Show("Пароли не совпадают");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Пароль не удовлетворяет требованиям\n-Минимум 6 символов\n-Минимум 1 прописная буква\n-По крайней мере один из следующих символов: ! @ # $ % ^");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Неверный адрес эл. почты");
                    }
                }
                else
                {
                    MessageBox.Show("В марафоне могут принять участие люди достигшие 10 лет и старше!");
                }
            }
        }
Beispiel #3
0
        public RegEventForm(int id)
        {
            InitializeComponent();
            tm.Tick    += timer1_Tick;
            tm.Interval = 1000;
            tm.Enabled  = true;
            tm.Start();
            runnerId = id;
            SqlConnClass scc = new SqlConnClass();
            RegEventForm rf  = this;

            scc.RegEventLoad(rf);
            sumCalc();
        }
        public void RegEventLoad(RegEventForm rf)
        {
            string          connStr = "server=localhost;user=root;database=pafenov;password="******"SELECT CharityName FROM charity";
            MySqlCommand    command = new MySqlCommand(sql, conn);
            MySqlDataReader reader  = command.ExecuteReader();

            while (reader.Read())
            {
                rf.comboBox1.Items.Add(reader[0].ToString());
            }
            reader.Close();
            conn.Close();
        }