using ClientLib; using ClientLib.CommonService; using DevExpress.XtraEditors; using PublicLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading; using System.Windows.Forms; namespace HANMI_J_SALE { partial class SelectAccNoPopup : XtraForm { public string m_BANK_CD, m_ACC_NO, m_ACC_NM, m_BANK_NM; public SelectAccNoPopup() { InitializeComponent(); m_BANK_CD = ""; m_ACC_NO = ""; m_ACC_NM = ""; m_BANK_NM = ""; this.Shown += (sender, e) => { searchProc(); }; gridView_Main.KeyPress += (sender, e) => { if (e.KeyChar == '\r') { DataRow row = gridView_Main.GetFocusedDataRow(); if (row != null) { m_BANK_CD = UtilClass.toStr(row["BANK_CD"]); m_ACC_NO = UtilClass.toStr(row["ACC_NO"]); m_ACC_NM = UtilClass.toStr(row["ACC_NM"]); m_BANK_NM = UtilClass.toStr(row["BANK_NM"]); this.DialogResult = DialogResult.Yes; this.Close(); } } }; gridView_Main.DoubleClick += (sender, e) => { DataRow row = gridView_Main.GetFocusedDataRow(); if (row != null) { m_BANK_CD = UtilClass.toStr(row["BANK_CD"]); m_ACC_NO = UtilClass.toStr(row["ACC_NO"]); m_ACC_NM = UtilClass.toStr(row["ACC_NM"]); m_BANK_NM = UtilClass.toStr(row["BANK_NM"]); this.DialogResult = DialogResult.Yes; this.Close(); } }; simpleButton_SELECT.Click += (sender, e) => { DataRow row = gridView_Main.GetFocusedDataRow(); if (row != null) { m_BANK_CD = UtilClass.toStr(row["BANK_CD"]); m_ACC_NO = UtilClass.toStr(row["ACC_NO"]); m_ACC_NM = UtilClass.toStr(row["ACC_NM"]); m_BANK_NM = UtilClass.toStr(row["BANK_NM"]); this.DialogResult = DialogResult.Yes; this.Close(); } }; simpleButton_Cancel.Click += (sender, e) => { this.DialogResult = DialogResult.Cancel; this.Close(); }; } public void searchProc() { try { this.Cursor = Cursors.WaitCursor; gridControl_Main.DataSource = null; SerializedSqlParam[] aParam = new SerializedSqlParam[] { ClientClass.CreateSqlParameter("COMP_CD", SqlDbType.NVarChar, ConstClass._COMP_CD) }; ResultData resultData = ClientClass.GetData("GetSelectAccNoPopup", aParam); if (resultData.isError) { throw new Exception(resultData.ResultValue); } gridControl_Main.DataSource = resultData.TableData; gridView_Main.Focus(); this.Cursor = Cursors.Arrow; } catch (Exception ex) { this.Cursor = Cursors.Arrow; MessageBox.Show(ex.Message); } } } }