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