private void SlaverBtnClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Common.frmSelItem mySelItem = new Common.frmSelItem(); mySelItem.myBill = this; if (mySelItem.ShowDialog() == DialogResult.OK) { DataRow dr; DataRow drCurrent = ((DataRowView)binItem.Current).Row; DataLib.sysClass myClass = new DataLib.sysClass(); if (mySelItem.TabControl.SelectedTabPageIndex == 0) { dr = mySelItem.gvMain.GetDataRow(mySelItem.gvMain.FocusedRowHandle); myClass.GetItem(dr["F_ID"].ToString(), 0, drCurrent, this.Name); gvItem.UpdateCurrentRow(); } else { dr = mySelItem.gvStore.GetDataRow(mySelItem.gvStore.FocusedRowHandle); myClass.GetStoreItem(dr, 0, drCurrent, this.Name); gvItem.UpdateCurrentRow(); } } mySelItem.Dispose(); }
private void txtBarCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { DataLib.sysClass myClass = new DataLib.sysClass(); DataRow dr = null; if (myBill.binSlaver.Count == 0) { dr = ((DataRowView)myBill.binSlaver.AddNew()).Row; } else { dr = ((DataRowView)myBill.binSlaver.Current).Row; } if (myClass.GetItem(txtBarCode.Text, 1, dr, myBill.Name) == false) { txtBarCode.SelectAll(); } else { txtBarCode.Text = ""; } } }