Esempio n. 1
0
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         if (!CheckArgsIsOK())
         {
             return;
         }
         if (_db == null)
         {
             _db = DBConnect.GetInstance();//创建数据库连接
         }
         ConcatSQL cSql = new ConcatSQL();
         cSql.ConcatSQLByUIControls(_ui);//根据界面条件生成相应的sql语句;
         if (dr == null)
         {
             dr = new DataReader(_ui, _db, dataGridViewDay, dataGridViewPeriod);//创建查询结果的识别语句,并把结果输出到gridview
         }
         _db.OpenConnection();
         _db.Retrieval(cSql.Sql, dr.DataReaderImplementation);//执行查询
         _db.CloseConnection();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
 private void btnQueryCloudsat_Click(object sender, EventArgs e)
 {
     try
     {
         if (!CheckCloudSATArgsIsOK())
         {
             return;
         }
         if (_db == null)
         {
             _db = DBConnect.GetInstance();//创建数据库连接
         }
         string sql = ConcatCloudsatSQL();
         dr = new DataReader(_ui, _db, dataGridViewCldSAT);       //创建查询结果的识别语句,并把结果输出到gridview
         _db.OpenConnection();
         _db.Retrieval(sql, dr.DataReaderImplementationCloudSAT); //执行查询
         _db.CloseConnection();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }