Exemple #1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            string      factQuery;
            FormClients fc = new FormClients();

            factQuery = "(`surname`, `name`, `patronimyc`, `phone_number`, `cars_number_sts`) VALUES('" +
                        textBox1.Text + "', '" + textBox2.Text + "', '" + textBox3.Text + "', '" + textBox4.Text + "', '" + cbNumSTS.Text + "');";
            db.Add("clients", factQuery, fc.dataGridView1);
            this.Hide();
        }
Exemple #2
0
        private void AddClientToDB(string surname, string name, string patronimyc, string phone, string brand, string model, string year, string sts)
        {
            //Сначала делаем запрос к таблице с машинами потому что клиенты связаны с машинами

            string factQuery;

            FormCars fc = new FormCars();

            factQuery = "(`number_sts`, `brand`, `model`, `year_created`) VALUES('" +
                        sts + "', '" + brand + "', '" + model + "', '" + year + "');";
            db.Add("cars", factQuery, fc.dataGridView1);

            FormClients fm = new FormClients();

            factQuery = "(`surname`, `name`, `patronimyc`,`phone_number` ,`cars_number_sts`) VALUES('" +
                        surname + "', '" + name + "', '" + patronimyc + "', '" + phone + "', '" + sts + "');";
            db.Add("clients", factQuery, fm.dataGridView1);
        }
Exemple #3
0
        private void btClients_Click(object sender, EventArgs e)
        {
            FormClients fc = new FormClients();

            fc.ShowDialog();
        }