public void checkcuspro(string ac, TextBox a, TextBox b, string sql, Frm_cuspro F) { try { string kq = gen.GetString("select * from hamaco.dbo.AccountingObject where AccountingObjectCode='" + a.Text + "'"); MessageBox.Show("Mã khách hàng, nhà cung cấp này đã tồn tại.", "Thông báo"); } catch { gen.ExcuteNonquery(sql); gen.ExcuteNonquery("insert into hamaco_ta.dbo.AccountingObject select * from hamaco.dbo.AccountingObject where AccountingObjectCode='" + a.Text + "'"); gen.ExcuteNonquery("insert into hamaco_tn.dbo.AccountingObject select * from hamaco.dbo.AccountingObject where AccountingObjectCode='" + a.Text + "'"); gen.ExcuteNonquery("insert into hamaco_vithanh.dbo.AccountingObject select * from hamaco.dbo.AccountingObject where AccountingObjectCode='" + a.Text + "'"); //gen.ExcuteNonquery("insert into hamaco_qlk.dbo.AccountingObject select * from hamaco.dbo.AccountingObject where AccountingObjectCode='" + a.Text + "'"); F.myac(); F.Close(); } }