File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    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 SelectCustomerForm : XtraForm
    {
        public string m_CUST_CD;
        public string m_CUST_NM;
        public string m_TEL_NO;
        public string m_OWNER_TEL_NO;
        public string m_MGR_TEL_NO;
        public string m_CUST_USR_ID;
        public string m_CUST_USR_NM;
        public int m_CURR_REMAIN_MONEY;
        private DateTime m_DT;
        public SelectCustomerForm(string cust_nm, DateTime dt)
        {
            InitializeComponent();
            textEdit_Search.Text = cust_nm;
            m_DT = dt;
            this.Shown += (sender, e) =>
            {
                searchProc();
            };
            textEdit_Search.KeyPress += (sender, e) =>
            {
                if (e.KeyChar == '\r')
                {
                    searchProc();
                }
            };
            simpleButton_Text_Clear.Click += (sender, e) =>
            {
                textEdit_Search.Text = "";
            };
            simpleButton_Search.Click += (sender, e) =>
            {
                searchProc();
            };
            radioGroup_CUST_KIND.EditValueChanged += (sender, e) =>
            {
                searchProc();
            };
            radioGroup_ORDER_BY.EditValueChanged += (sender, e) =>
            {
                searchProc();
            };
            radioGroup_CUST_NAME_GBN.EditValueChanged += (sender, e) =>
            {
                searchProc();
            };
            gridView_Main.KeyPress += (sender, e) =>
            {
                if (e.KeyChar == '\r')
                {
                    DataRow row = gridView_Main.GetFocusedDataRow();
                    if (row != null)
                    {
                        m_CUST_CD = UtilClass.toStr(row["CUST_CD"]);
                        m_CUST_NM = UtilClass.toStr(row["CUST_NM"]);
                        m_TEL_NO = UtilClass.toStr(row["TEL_NO"]);
                        m_OWNER_TEL_NO = UtilClass.toStr(row["OWNER_TEL_NO"]);
                        m_MGR_TEL_NO = UtilClass.toStr(row["MGR_TEL_NO"]);
                        m_CUST_USR_ID = UtilClass.toStr(row["CUST_USR_ID"]);
                        m_CUST_USR_NM = UtilClass.toStr(row["CUST_USR_NM"]);
                        m_CURR_REMAIN_MONEY = UtilClass.toInt(row["CURR_REMAIN_MONEY"]);
                        this.DialogResult = DialogResult.Yes;
                        this.Close();
                    }
                }
            };
            gridView_Main.DoubleClick += (sender, e) =>
            {
                DataRow row = gridView_Main.GetFocusedDataRow();
                if (row != null)
                {
                    m_CUST_CD = UtilClass.toStr(row["CUST_CD"]);
                    m_CUST_NM = UtilClass.toStr(row["CUST_NM"]);
                    m_TEL_NO = UtilClass.toStr(row["TEL_NO"]);
                    m_OWNER_TEL_NO = UtilClass.toStr(row["OWNER_TEL_NO"]);
                    m_MGR_TEL_NO = UtilClass.toStr(row["MGR_TEL_NO"]);
                    m_CUST_USR_ID = UtilClass.toStr(row["CUST_USR_ID"]);
                    m_CUST_USR_NM = UtilClass.toStr(row["CUST_USR_NM"]);
                    m_CURR_REMAIN_MONEY = UtilClass.toInt(row["CURR_REMAIN_MONEY"]);
                    this.DialogResult = DialogResult.Yes;
                    this.Close();
                }
            };
            simpleButton_OK.Click += (sender, e) =>
            {
                DataRow row = gridView_Main.GetFocusedDataRow();
                if (row != null)
                {
                    m_CUST_CD = UtilClass.toStr(row["CUST_CD"]);
                    m_CUST_NM = UtilClass.toStr(row["CUST_NM"]);
                    m_TEL_NO = UtilClass.toStr(row["TEL_NO"]);
                    m_OWNER_TEL_NO = UtilClass.toStr(row["OWNER_TEL_NO"]);
                    m_MGR_TEL_NO = UtilClass.toStr(row["MGR_TEL_NO"]);
                    m_CUST_USR_ID = UtilClass.toStr(row["CUST_USR_ID"]);
                    m_CUST_USR_NM = UtilClass.toStr(row["CUST_USR_NM"]);
                    m_CURR_REMAIN_MONEY = UtilClass.toInt(row["CURR_REMAIN_MONEY"]);
                }
            };
            simpleButton_Cancel.Click += (sender, e) =>
            {
                this.DialogResult = DialogResult.Cancel;
                this.Close();
            };
            this.ActiveControl = textEdit_Search;
            this.textEdit_Search.Focus();
        }
        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),
                    ClientClass.CreateSqlParameter("CUST_KIND", SqlDbType.NVarChar, radioGroup_CUST_KIND.EditValue),
                    ClientClass.CreateSqlParameter("ORDER_BY", SqlDbType.Int, radioGroup_ORDER_BY.EditValue),
                    ClientClass.CreateSqlParameter("DEL_YN", SqlDbType.NVarChar, checkBox_DEL_YN.Checked ? 'N':'Y'),
                    ClientClass.CreateSqlParameter("CUST_NAME_GBN", SqlDbType.Int, radioGroup_CUST_NAME_GBN.SelectedIndex),
                    ClientClass.CreateSqlParameter("DT", SqlDbType.NVarChar, m_DT.ToString("yyyy.MM.dd")),
                    ClientClass.CreateSqlParameter("SEARCH", SqlDbType.NVarChar, textEdit_Search.Text)
                };
                ResultData resultData = ClientClass.GetData("GetSalesCustSelectPopup", 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;
                XtraMessageBox.Show(ex.Message);
            }
        }
    }
}