public void tsbtcuspro(string a, Form1 F, DevExpress.XtraGrid.Views.Grid.GridView view, string userid) { try { Frm_cuspro m = new Frm_cuspro(); m.myac = new Frm_cuspro.ac(F.refreshcuspro); m.getactive(a); m.getuserid(userid); if (a == "1") { m.getrole(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString()); } m.ShowDialog(); } catch { MessageBox.Show("Vui lòng chọn KH-NCC trước khi sửa."); } }
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(); } }