//this.Series.Clear(); //Series dataTable1Series = new Series("电压值"); //Series dataTable2Series = new Series("10CM含水率"); //Series dataTable3Series = new Series("20CM含水率"); //Series dataTable4Series = new Series("40CM含水率"); //dataTable1Series.Points.DataBind(dataTable1.AsEnumerable(), CS_Asix_DateTime, CS_Serial_Name_Votage, ""); //dataTable1Series.XValueType = ChartValueType.DateTime;//设置X轴类型为时间 //dataTable1Series.ChartType = SeriesChartType.Line; //设置Y轴为折线 //dataTable2Series.Points.DataBind(dataTable2.AsEnumerable(), CS_Asix_DateTime, CS_Serial_Name_M10, ""); //dataTable2Series.XValueType = ChartValueType.DateTime;//设置X轴类型为时间 //dataTable2Series.ChartType = SeriesChartType.Line; //设置Y轴为折线 //this.Series.Add(dataTable1Series); // this.Series.Add(dataTable2Series); public bool SetFilter(string iStationId, DateTime timeStart, DateTime timeEnd) { //this.InitUI(); m_annotation.Visible = false; ClearAllDatas(); List <CEntityWaterSpeed> listDatas = m_proxyWaterSpeed.QueryByTime(iStationId, timeStart, timeEnd); if (listDatas.Count > CI_Chart_Max_Count) { // 数据量太大,退出绘图 MessageBox.Show("查询结果集太大,自动退出绘图"); return(false); } AddSoilData(listDatas); //显示图形 return(true); //m_annotation.Visible = false; //ClearAllDatas(); //List<CEntitySoilData> listDatas = m_proxySoilData.QueryByStationAndTime(iStationId, timeStart, timeEnd); //int rowcount = listDatas.Count; //if (rowcount > CI_Chart_Max_Count) //{ // // 数据量太大,退出绘图 // MessageBox.Show("查询结果集太大,自动退出绘图"); // return false; //} //AddSoilData(listDatas); //显示图形 //return true; }
public bool SetFilter(string iStationId, DateTime timeStart, DateTime timeEnd, bool TimeSelect) { m_annotation.Visible = false; ClearAllDatas(); m_dMaxWaterFlow = null; m_dMaxWaterStage = null; m_dMinWaterFlow = null; m_dMinWaterStage = null; List <CEntityWaterSpeed> listWaterSpeed = new List <CEntityWaterSpeed>(); List <CEntityWaterSpeed> listSharpClockWaterSpeed = new List <CEntityWaterSpeed>(); try { listWaterSpeed = m_proxyWaterSpeed.QueryByTime(iStationId, timeStart, timeEnd); if (listWaterSpeed == null || listWaterSpeed.Count == 0) { MessageBox.Show("数据库忙,查询失败,请稍后再试!"); return(false); } else { if (TimeSelect) { for (int i = 0; i < listWaterSpeed.Count; i++) { if (listWaterSpeed[i].DT.Minute == 0 && listWaterSpeed[i].DT.Second == 0) { listSharpClockWaterSpeed.Add(listWaterSpeed[i]); } } this.AddWaters(listSharpClockWaterSpeed); return(true); } this.AddWaters(listWaterSpeed); return(true); } } catch (Exception eee) { MessageBox.Show("数据库忙,查询失败,请稍后再试!"); return(false); } }
// 设置查询条件 public bool SetFilter(string strStationId, DateTime timeStart, DateTime timeEnd, bool TimeSelect) { List <CEntityWaterSpeed> listWaterSpeed = new List <CEntityWaterSpeed>(); List <CEntityWaterSpeed> listSharpClockWaterSpeed = new List <CEntityWaterSpeed>(); try { listWaterSpeed = m_proxySpeedWater.QueryByTime(strStationId, timeStart, timeEnd); if (listWaterSpeed == null || listWaterSpeed.Count == 0) { MessageBox.Show("数据库忙,查询失败,请稍后再试!"); return(false); } else { if (TimeSelect) { for (int i = 0; i < listWaterSpeed.Count; i++) { if (listWaterSpeed[i].DT.Minute == 0 && listWaterSpeed[i].DT.Second == 0) { listSharpClockWaterSpeed.Add(listWaterSpeed[i]); } } SetWaters(listSharpClockWaterSpeed); return(true); } SetWaters(listWaterSpeed); return(true); } }catch (Exception eee) { MessageBox.Show("数据库忙,查询失败,请稍后再试!"); return(false); } }