示例#1
0
        private void add_Click(object sender, EventArgs e)
        {
            if (!type)
            {
                string querry = "UPDATE Договора SET date_sub = '" + today.Text.ToString() + "', id_clients = '" + clients_id.Text.ToString() + "', name_clients = '" +
                                clients_f.Text.ToString() + "', id_master = '" + master_id.Text.ToString() + "', name_master = '" + master_f.Text.ToString() + "', id_subscription = '" +
                                sub_id.Text.ToString() + "', name_subscription = '" + sub_title.Text.ToString() + "', id_hall = '" + hall_id.Text.ToString() + "', name_hall = '" +
                                hall_title.Text.ToString() + "', date_start = '" + date_start.Text.ToString() + "', date_end = '" + date_end.Text.ToString() + "', price = '" + all_price.Text.ToString() + "' WHERE id = " + data[0];

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

                myConnection.Close();

                Form contract = new contract();
                contract.Show();
                this.Close();
            }
            else
            {
                string querry = "INSERT INTO Договора (date_sub, id_clients, name_clients, id_master, name_master, id_subscription, name_subscription, id_hall, name_hall, date_start, date_end, price) " +
                                "VALUES ('" + today.Text.ToString() + "','" + clients_id.Text.ToString() + "','" + clients_f.Text.ToString() + "','" + master_id.Text.ToString() + "','" +
                                master_f.Text.ToString() + "','" + sub_id.Text.ToString() + "','" + sub_title.Text.ToString() + "','" + hall_id.Text.ToString() + "','" + hall_title.Text.ToString() + "','"
                                + date_start.Text.ToString() + "','" + date_end.Text.ToString() + "','" + all_price.Text.ToString() + "')";

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

                myConnection.Close();

                Form contract = new contract();
                contract.Show();
                this.Close();
            }
        }
示例#2
0
        private void button_contract_Click(object sender, EventArgs e)
        {
            Form contract = new contract();

            contract.Show();
            this.Hide();
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            myConnection.Close();
            Form contract = new contract();

            contract.Show();
            this.Close();
        }
示例#4
0
        private void add_Click(object sender, EventArgs e)
        {
            string querry = "INSERT INTO Договора (id_clients, id_subscription, id_hall, date_start, date_end) " +
                            "VALUES ('" + comboBox1.Text.ToString() + "','" + comboBox2.Text.ToString() + "','" + comboBox3.Text.ToString() + "','" + date_start.Text.ToString() + "','" + date_end.Text.ToString() + "')";
            OleDbCommand command = new OleDbCommand(querry, myConnection);

            command.ExecuteNonQuery();

            myConnection.Close();

            Form contract = new contract();

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