private void btn_Forecast_Click(object sender, EventArgs e) { string StartTime, EndTime; string[] Num = txt_Equip.Text.Split('#'); StartTime = func.Time_Format(DTP1.Value.ToString()); EndTime = func.Time_Format(DTP2.Value.ToString()); //////查询 dataset.Clear(); if (CkListBox1.GetItemChecked(0)) { try { dataset = ServiceContainer.GetService <IGasDAL>().QueryData("TIME , FLOW", Num[1] + Num[0] + "_REAL", "TIME", StartTime, EndTime); } catch (Exception ex) { Console.WriteLine("查询异常" + ex.Message); return; } //dataset = ServiceContainer.GetService<IGasDAL>().QueryData(ModuleClass.FuncClass.ActivContrl[1].ToString() + Num[0] + "_REAL"); } if (CkListBox1.GetItemChecked(1)) { try { dataset = ServiceContainer.GetService <IGasDAL>().QueryData(Num[1] + Num[0] + "_FCST"); } catch (Exception ex) { Console.WriteLine("查询异常" + ex.Message); return; } } if (CkListBox1.GetItemChecked(2)) { try { dataset = ServiceContainer.GetService <IGasDAL>().QueryData(Num[1] + Num[0] + "_REAL"); } catch (Exception ex) { Console.WriteLine("查询异常" + ex.Message); return; } } ////设置DG DG1.DataSource = dataset.Tables[0]; ////画图 SetGragh(zg1); }
private void btn_Query_Click(object sender, EventArgs e) { string StartTime, EndTime; string[] Num = cbox1.Text.Split('#'); StartTime = func.Time_Format(DTP1.Value.ToString()); EndTime = func.Time_Format(DTP2.Value.ToString()); //////查询 dataset.Clear(); if (CkListBox1.GetItemChecked(0)) { dataset = ServiceContainer.GetService <IGasDAL>().QueryData("TIME , FLOW", ModuleClass.FuncClass.ActivContrl[1].ToString() + Num[0] + "_REAL", "TIME", StartTime, EndTime); //dataset = ServiceContainer.GetService<IGasDAL>().QueryData(ModuleClass.FuncClass.ActivContrl[1].ToString() + Num[0] + "_REAL"); } if (CkListBox1.GetItemChecked(1)) { dataset = ServiceContainer.GetService <IGasDAL>().QueryData(ModuleClass.FuncClass.ActivContrl[1].ToString() + Num[0] + "_FCST"); } if (CkListBox1.GetItemChecked(2)) { dataset = ServiceContainer.GetService <IGasDAL>().QueryData(ModuleClass.FuncClass.ActivContrl[1].ToString() + Num[0] + "_REAL"); } ////设置DG DG1.DataSource = dataset.Tables[0]; ////画图 SetGragh(zg1); }