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

            factQuery = "(`number_sts`, `brand`, `model`, `year_created`, `date_to`) VALUES('" +
                        tbNumSTS.Text + "', '" + tbBrand.Text + "', '" + tbModel.Text + "', '" + tbYear.Text + "', '"
                        + tbDateTO.Text + "');";
            db.Add("cars", factQuery, fc.dataGridView1);
            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 btCars_Click(object sender, EventArgs e)
        {
            FormCars fCars = new FormCars();

            fCars.ShowDialog();
        }