Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int a = 0;

            if (textBox1.Text != "" && textBox2.Text != "")
            {
                if (textBox1.Text == "admin" && textBox2.Text == "yravn")
                {
                    Form4 f2 = new Form4();
                    f2.Show();
                    textBox1.Text = "";
                    textBox2.Text = "";
                    this.Hide();
                }
                else
                {
                    for (int i = 0; i < dataGridView1.RowCount; i++)
                    {
                        if (dataGridView1[0, i].FormattedValue.ToString() == textBox1.Text && dataGridView1[1, i].FormattedValue.ToString() == textBox2.Text)
                        {
                            a = 1;
                            MessageBox.Show("Вход успешен");
                            Form7 f7 = new Form7();
                            Form3 f2 = new Form3();
                            if (dataGridView1[5, i].FormattedValue.ToString() != "Пользователь")
                            {
                                f7.Show();
                            }
                            else
                            {
                                f2.Show();
                            }
                            f2.label3.Text = textBox1.Text;
                            textBox1.Text  = "";
                            textBox2.Text  = "";
                            this.Hide();
                            break;
                        }
                    }

                    if (a == 0)
                    {
                        MessageBox.Show("Вы ввели неверные данные");
                    }
                }
            }
            else
            {
                MessageBox.Show("Вы не ввели данные");
            }
        }
Exemple #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            object x = dataGridView1.Rows[e.RowIndex].Cells[0].Value;
            Form7  m;

            if (type == 1)
            {
                m = new Form7((int)x, userid, 1);
            }
            else
            {
                m = new Form7(userid, (int)x, 0);
            }
            m.Show();
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            string datasource = textBox1.Text;
            string database   = textBox2.Text;
            string username   = textBox3.Text ?? "";
            string userpass   = textBox4.Text ?? "";

            if (string.IsNullOrEmpty(datasource) || string.IsNullOrEmpty(database))
            {
                MessageBox.Show("Ошибка! Не все поля заполнены.", "Ошибка соединения", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (DBConnectionService.SetSqlConnection(GetDBConnectionString(datasource, database, username, userpass)))
            {
                MessageBox.Show("Выполнен!", "Соединение подключено", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                Form7 sistema = new Form7();
                sistema.ShowDialog();
                this.Close();
            }
        }
Exemple #4
0
        private void aÇIKLIKToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form7 acıklık = new Form7();

            acıklık.ShowDialog();
        }
Exemple #5
0
        private void button6_Click(object sender, EventArgs e)
        {
            Form fm6 = new Form7();

            fm6.Show();
        }
Exemple #6
0
        private void 房间信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form7 form7 = new Form7();

            form7.Show();
        }
Exemple #7
0
        private void столбецToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form7 form7 = new Form7(this);

            form7.ShowDialog();
        }
Exemple #8
0
        private void x2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form na2 = new Form7();

            na2.Show();
        }