Пример #1
0
        /// <summary>
        ///
        /// </summary>
        private void Query()
        {
            int[] deviceIDs = this.UCRain1.SelectedStationCollection.GetDeviceCollection().GetDeviceIDs();
            if (deviceIDs.Length == 1)
            {
                RangeType rt    = this.UCRain1.RangeType;
                DateTime  begin = this.UCRain1.Begin;
                DateTime  end   = this.UCRain1.End;

                DataTable tbl = null;

                switch (rt)
                {
                case RangeType.Real:
                    tbl = RainDBI.GetData(begin, end, deviceIDs);
                    break;

                case RangeType.Day:
                case RangeType.Month:
                case RangeType.Year:
                    tbl = RainDBI.GetDayData(begin, end, deviceIDs);
                    break;
                }

                H.DataSource = tbl;
                H.Bind();
            }
            else
            {
                ClientScript.RegisterStartupScript(
                    this.GetType(), "key",
                    JavaScriptHelper.GetAlertScript("只能选择一个测点.")
                    );
            }
        }