public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
                conn.Open();

            DataTable tb = new DataTable();

            this.DAOList_ = new List<CurveHeaderInfo_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CurveHeaderInfo_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr = tb.Select();
            int rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CurveHeaderInfo_Table_DAO dao = new CurveHeaderInfo_Table_DAO();

                dao.CURVE_CODE_ = item[0].ToString();
                dao.CURVE_NAME_ = item[1].ToString();
                dao.CURVE_CLASS_ = item[2].ToString();
                dao.DISCRIPTION_ = item[3].ToString();

                this.DAOList_.Add(dao);
            }



        }
Exemplo n.º 2
0
        public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }

            DataTable tb = new DataTable();

            this.DAOList_ = new List <CurveHeaderInfo_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CurveHeaderInfo_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr       = tb.Select();
            int       rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CurveHeaderInfo_Table_DAO dao = new CurveHeaderInfo_Table_DAO();

                dao.CURVE_CODE_  = item[0].ToString();
                dao.CURVE_NAME_  = item[1].ToString();
                dao.CURVE_CLASS_ = item[2].ToString();
                dao.DISCRIPTION_ = item[3].ToString();

                this.DAOList_.Add(dao);
            }
        }
Exemplo n.º 3
0
        private void curveListView__PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            CurveHeaderInfo_Table_DAO selectedItem = this.curveListView_.SelectedItem as CurveHeaderInfo_Table_DAO;

            this.viewModel_.loadData(new DateTime(), "");
        }