Exemplo n.º 1
0
        private void QRS010_QueryLunch_Load(object sender, EventArgs e)
        {
            this.tsbNew.Visible       = false;
            this.tsSeperator1.Visible = false;
            this.tsbRefresh.Text      = "Query";


            this.shtQueryList.ActiveSkin = Common.ACTIVE_SKIN;
            this.shtView.ActiveSkin      = Common.ACTIVE_SKIN;

            CtrlUtil.MappingDataFieldWithEnum(shtQueryList, typeof(eColQueryList));


            QueryLunchBiz biz = new QueryLunchBiz();
            DataTable     dt  = biz.GetQueryList();

            m_dtQueryList = dt;
            this.shtQueryList.DataSource = dt;
        }
Exemplo n.º 2
0
        private void LoadData()
        {
            try
            {
                QueryLunchDTO dto = new QueryLunchDTO();
                dto.SQLCommand = this.txtSearch.Text.ToNZString();


                QueryLunchBiz biz      = new QueryLunchBiz();
                DataSet       dsResult = biz.ExecuteSQLCommand(dto);

                this.m_dtAllData         = null;
                this.shtView.DataSource  = null;
                this.shtView.RowCount    = 0;
                this.shtView.ColumnCount = 0;

                if (dsResult.Tables.Count > 0)
                {
                    if (dsResult.Tables[0].Rows.Count > 0)
                    {
                        this.m_dtAllData = dsResult.Tables[0];

                        this.shtView.DataSource = m_dtAllData;
                    }
                    else
                    {
                        MessageBox.Show("หาไม่เจอเว้ยยยยยยยย");
                    }
                }
                else
                {
                    MessageBox.Show("query ภาษาอะไรวะ");
                }
            }
            catch (DataAccessException ex)
            {
                MessageBox.Show("ไปเรียน Query ใหม่ซะไป๊");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }