public void tsbtpnk(string a, Form1 F, DevExpress.XtraGrid.Views.Grid.GridView view, string roleid, string subsys, string ngaychungtu, string userid, string branchid) { try { Frm_phieunhapgas u = new Frm_phieunhapgas(); u.myac = new Frm_phieunhapgas.ac(F.refreshpnkgas); u.getactive(a); u.getroleid(roleid); u.getsub(subsys); u.getpt("pnk"); u.getdate(ngaychungtu); u.getuser(userid); u.getbranch(branchid); /*try * {*/ if (a == "1") { u.getrole(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString()); } else { try { u.getrole(view.GetRowCellValue(view.FocusedRowHandle, "Mã kho").ToString()); } catch { u.getrole(gen.GetString("select Top 1 StockCode from Stock where StockID in (select StockID from MSC_UserJoinStock where UserID='" + userid + "') order by StockCode")); } } /*} * catch { }*/ u.ShowDialog(); } catch { MessageBox.Show("Vui lòng chọn phiếu nhập kho Gas trước khi sửa."); } }