Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form master = new master();

            master.Show();
            this.Hide();
        }
Example #2
0
        private void add_Click(object sender, EventArgs e)
        {
            if (type)
            {
                string querry = "INSERT INTO Тренера (first_name, last_name, middle_name, birth_date, sex, phone, email, address, hall, price) " +
                                "VALUES ('" + first_name.Text.ToString() + "','" + last_name.Text.ToString() + "','" + middle_name.Text.ToString() + "','" +
                                birth_date.Text.ToString() + "','" + sex.Text.ToString() + "','" + phone.Text.ToString() + "','" + email.Text.ToString() + "','" +
                                address.Text.ToString() + "','" + hall.Text.ToString() + "','" + price.Text.ToString() + "')";

                OleDbCommand command = new OleDbCommand(querry, myConnection);
                command.ExecuteNonQuery();

                myConnection.Close();
                Form master = new master();
                master.Show();
                this.Close();
            }
            else
            {
                string querry = "UPDATE Тренера SET first_name = '" + first_name.Text.ToString() + "', last_name = '" + last_name.Text.ToString() +
                                "', middle_name = '" + middle_name.Text.ToString() + "', birth_date = '" + Convert.ToDateTime(birth_date.Text) + "', sex = '"
                                + sex.Text.ToString() + "', phone = '" + phone.Text.ToString() + "', email = '" + email.Text.ToString() + "', address = '" + address.Text.ToString()
                                + "', hall = '" + hall.Text.ToString() + "', price = '" + price.Text.ToString() + "' WHERE id = " + data[0];

                OleDbCommand command = new OleDbCommand(querry, myConnection);
                command.ExecuteNonQuery();
                updateAll();

                myConnection.Close();
                Form master = new master();
                master.Show();
                this.Close();
            }
        }
Example #3
0
        private void add_Click(object sender, EventArgs e)
        {
            string querry = "INSERT INTO Тренера (first_name, last_name, middle_name, birth_date, phone, email) " +
                            "VALUES ('" + first_name.Text.ToString() + "','" + last_name.Text.ToString() + "','" + middle_name.Text.ToString() + "','" + birth_date.Text.ToString() + "','" + phone.Text.ToString() + "','" + email.Text.ToString() + "')";
            OleDbCommand command = new OleDbCommand(querry, myConnection);

            command.ExecuteNonQuery();

            myConnection.Close();
            Form master = new master();

            master.Show();
            this.Close();
        }