private void tsbEdit_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { D07F2011 frm = new D07F2011(); int i = GridStore.View.FocusedRowData.RowHandle.Value; frm.VoucherID = L3ConvertType.L3String(GridStore.GetFocusedRowCellValue(COL_VoucherID)); frm.FormState = Lemon3.EnumFormState.FormEdit; frm.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; frm.ShowDialog(); LoadTDBGrid(); GridStore.FocusRowHandle(i); }
private void tsbView_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { D07F2011 frm = new D07F2011(); int i = GridStore.View.FocusedRowData.RowHandle.Value; frm.VoucherID = L3ConvertType.L3String(GridStore.GetFocusedRowCellValue(COL_VoucherID)); frm.FormState = Lemon3.EnumFormState.FormView; frm.GridVoucherInventory.View.IsEnabled = false; frm.lkeSupplier.IsReadOnly = true; frm.deVoucherDate.IsReadOnly = true; frm.chePaid.IsReadOnly = true; frm.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; frm.ShowDialog(); LoadTDBGrid(); GridStore.FocusRowHandle(i); }
private void tsbDelete_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { string VoucherID = GridStore.GetFocusedRowCellValue(COL_VoucherID).ToString(); int i = GridStore.View.FocusedRowData.RowHandle.Value; StringBuilder sSQL = new StringBuilder(); sSQL.AppendLine(BLStore.SQLDeleteD07T2011(VoucherID)); sSQL.AppendLine(BLStore.SQLDeleteD07T2010(VoucherID)); try { L3SQLServer.ExecuteSQL(sSQL.ToString()); } catch (Exception) { MessageBox.Show("Lỗi!"); } LoadTDBGrid(); GridStore.FocusRowHandle(i); }