コード例 #1
0
        // 设置查询条件
        public bool SetFilter(string strStationId, DateTime timeStart, DateTime timeEnd, bool TimeSelect)
        {
            List <CEntityVoltage> voltageList = new List <CEntityVoltage>();

            // 清空所有状态
            ClearAllState();
            m_strStaionId   = strStationId;
            m_dateTimeStart = timeStart;
            m_dateTimeEnd   = timeEnd;
            //m_proxyVoltage.SetFilter(strStationId, timeStart, timeEnd, TimeSelect);
            try
            {
                voltageList = m_proxyVoltage.SetFilterData(strStationId, timeStart, timeEnd, TimeSelect);
            }
            catch (Exception e) {
                MessageBox.Show("数据库忙,查询失败,请稍后再试!");
                return(false);
            };
            // 并查询数据,显示第一页
            this.OnMenuFirstPage(this, null);
            base.TotalPageCount = m_proxyVoltage.GetPageCount();
            base.TotalRowCount  = m_proxyVoltage.GetRowCount();
            SetVoltage(voltageList);
            return(true);
        }
コード例 #2
0
 // 设置查询条件
 public bool SetFilter(string strStationId, DateTime timeStart, DateTime timeEnd, bool TimeSelect)
 {
     // 清空所有状态
     ClearAllState();
     m_strStaionId   = strStationId;
     m_dateTimeStart = timeStart;
     m_dateTimeEnd   = timeEnd;
     m_proxyVoltage.SetFilter(strStationId, timeStart, timeEnd, TimeSelect);
     if (-1 == m_proxyVoltage.GetPageCount())
     {
         MessageBox.Show("数据库忙,查询失败,请稍后再试!");
         return(false);
     }
     else
     {
         // 并查询数据,显示第一页
         this.OnMenuFirstPage(this, null);
         base.TotalPageCount = m_proxyVoltage.GetPageCount();
         base.TotalRowCount  = m_proxyVoltage.GetRowCount();
         SetVoltage(m_proxyVoltage.GetPageData(1));
         return(true);
     }
 }
コード例 #3
0
        public bool SetFilter(string iStationId, DateTime timeStart, DateTime timeEnd, bool TimeSelect)
        {
            bool result = false;

            m_annotation.Visible = false;
            base.ClearAllDatas();
            m_proxyVoltage.SetFilter(iStationId, timeStart, timeEnd, TimeSelect);
            if (-1 == m_proxyVoltage.GetPageCount())
            {
                // 查询失败
                // MessageBox.Show("数据库忙,查询失败,请稍后再试!");
                return(result);
            }
            else
            {
                int rowcount = m_proxyVoltage.GetRowCount();
                if (rowcount > CI_Chart_Max_Count)
                {
                    // 数据量太大,退出绘图
                    MessageBox.Show("查询结果集太大,自动退出绘图");
                    return(result);
                }
                // 并查询数据,显示第一页
                int iTotalPage = m_proxyVoltage.GetPageCount();
                for (int i = 0; i < iTotalPage; ++i)
                {
                    // 查询所有的数据
                    result = this.AddVoltages(m_proxyVoltage.GetPageData(i + 1));
                    if (result == false)
                    {
                        MessageBox.Show("数据超限,自动退出绘图");
                    }
                }
                return(result);
            }
        }