Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        private void btClients_Click(object sender, EventArgs e)
        {
            FormClients fc = new FormClients();

            fc.ShowDialog();
        }