Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Query()
        {
            // TODO: 2011-05-27 page_load 之前不能调用 IsValid
            //
            //if (IsValid)
            DateTime begin = UCConditionDTTwo1.Begin;
            DateTime end   = UCConditionDTTwo1.End;

            //int[] deviceIDs = UCConditionDTTwo1.GetQueryDeviceIDs();
            DeviceCollection dc = UCConditionDTTwo1.Stations.GetDeviceCollection();

            int[] deviceIDs = dc.GetDeviceIDs();
            if (deviceIDs.Length == 0)
            {
                // TODO: 2011-05-16 not select station msg
                //
                return;
            }

            DataTable tbl = DitchDataDBI.GetData(begin, end, deviceIDs);

            _h.Bind();
            //DataTable tbl = GetDataTable(begin, end, deviceIDs[0]);
            //ColumnNameTextCollection nts = GetColumnNameTextCollection();
            //GridViewHelper.SetGridViewColumn(this.GridView1, nts);
            //this.GridView1.DataSource = tbl;
            //this.DataBind();


            this.UCZedChart1.GraphPaneConfig = this.GetGraphPaneConfig();
            this.UCZedChart1.DataSource      = tbl;
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private DataTable GetDataTable()
        {
            DateTime begin = UCConditionDTTwo1.Begin;
            DateTime end   = UCConditionDTTwo1.End;

            //int[] deviceIDs = UCConditionDTTwo1.GetQueryDeviceIDs();
            DeviceCollection dc = UCConditionDTTwo1.Stations.GetDeviceCollection();

            int[] deviceIDs = dc.GetDeviceIDs();
            if (deviceIDs.Length == 0)
            {
                // TODO: 2011-05-16 not select station msg
                //
                return(null);
            }

            //DataTable tbl = DitchDataDBI.GetData(begin, end, deviceIDs);
            DataTable tbl = DitchDataDBI.GetData(begin, end, deviceIDs[0]);

            return(tbl);
        }