Beispiel #1
0
    protected void ddl_dt_SelectedIndexChanged(object sender, EventArgs e)
    {
        string dataTypeID = ddl_dt.SelectedValue;

        Model.RecordeData dataType = new Model.RecordeData();
        try
        {
            dataType.DataType = Convert.ToInt32(dataTypeID);
        }
        catch
        {
        }
        initDDLTimeType(dataType);
        ddl_timeSX.Items.Clear();
        ListItem newItemTimeSX = new ListItem();

        newItemTimeSX.Text  = "选择时效";
        newItemTimeSX.Value = "选择时效";
        ddl_timeSX.Items.Add(newItemTimeSX);
        p_gv.Visible             = false;
        p_print.Visible          = false;
        p_text.Visible           = true;
        p_noExistStation.Visible = false;
        p_timeInterval.Visible   = false;
        p_tip.Visible            = false;
        lb_titleTime.Text        = "";
        lb_noExistStation.Text   = "";

        //20120830 syy 增加最高温最低温相等提示
        //20130702 syy 初始化Tip信息
        initTipInfo();
    }
Beispiel #2
0
    public void testGetTimeType()
    {
        Model.RecordeData mrd = new Model.RecordeData();
        mrd.DataType = 1;

        BLL.DataBLL         dbll = new BLL.DataBLL();
        Model.RecordeData[] mrd2 = dbll.getTimeType(mrd);
        for (int i = 0; i < mrd2.Length; i++)
        {
            al.Add(mrd2[i]);
        }
    }
Beispiel #3
0
    protected void ddl_timeSX_SelectedIndexChanged(object sender, EventArgs e)
    {
        ////////////////////////////////////////////////
        //20130701 增加信息提示部分,包括天气现象、温度差异等等
        //////////////////////////////////////////////////
        initTipInfo();

        mRecordeData        = null;
        lb_titleTimeSX.Text = ddl_timeSX.SelectedItem.Text.Trim();
        string dataTypeID = ddl_dt.SelectedValue;
        string timeTypeID = ddl_tt.SelectedValue;
        string SXTypeID   = ddl_timeSX.SelectedValue;

        Model.RecordeData par_mrd = new Model.RecordeData();
        par_mrd.DataType = Convert.ToInt32(dataTypeID);
        par_mrd.TimeType = Convert.ToInt32(timeTypeID);
        if (lb_titleTimeSX.Text == "选择时效")
        {
            lb_titleTimeSX.Text    = "全部时效";
            p_timeInterval.Visible = false;
        }
        else
        {
            lb_titleTimeSX.Text   += "小时";
            p_timeInterval.Visible = true;
            par_mrd.Time           = Convert.ToInt32(SXTypeID);
        }
        fillGV(gv_citydata, par_mrd, SXTypeID);

        ////20120830 syy 增加最高温最低温相等提示
        //if (equalMaxMinTemStationName != null && equalMaxMinTemStationName.Count != 0)
        //{
        //    string equalMaxMinTemStationNameStr = "";
        //    foreach (DictionaryEntry de in equalMaxMinTemStationName)
        //    {
        //        equalMaxMinTemStationNameStr += de.Key + ",";
        //    }
        //    lb_equalMaxMinTemTip.Text = "最高温度和最低温度相等的城市有:" + equalMaxMinTemStationNameStr.Substring(0, equalMaxMinTemStationNameStr.Length - 1);

        //}

        //////////////////////////////////////////////////////////////////////////////////
        //private string equalTemMessage = "最高温和最低温一致的城市:";
        //private string hlTemMessage = "异常气温(最高温>=45℃,最低温<=-40℃)的城市:";
        //private string subTemMessage = "最高气温或者最低气温和前一天预报相差>=8℃的城市:";
        //private string lTemWethMessage = "最低气温>5℃,但天气现象为冻雨、雨夹雪、小雪、中雪、大雪、暴雪的城市:";
        //private string windNMessage = "有风力(>=3级),但无风向";
        //private string wethExpMessage = "天气现象为大暴雨、大暴雪";
        ////////////////////////////////////////////////////////////////////////////////

        showTipInfo();
    }
Beispiel #4
0
    protected void showTip(Model.RecordeData mRData)
    {
        if (mRData == null)
        {
            lb_titleTime.Text = "";
        }
        else
        {
            try
            {
                DateTime TimeZoneBegin = mRData.BeginTime;
                DateTime TimeZoneOver  = mRData.OverTime;
                lb_titleTimeZoneBegin.Text = formatTime(TimeZoneBegin);
                lb_titleTimeZoneOver.Text  = formatTime(TimeZoneOver);
            }
            catch
            {
            }

            DateTime dtReport  = mRData.ReportTime;
            string   strReport = dtReport.ToString("yyyy-MM-dd");
            if (strReport == DateTime.Now.ToString("yyyy-MM-dd"))
            {
                lb_titleTime.Text      = "今天:" + formatTime(dtReport);
                lb_titleTime.ForeColor = System.Drawing.Color.Blue;
            }
            else
            {
                if (strReport == DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))
                {
                    lb_titleTime.Text      = "昨天:" + formatTime(dtReport);
                    lb_titleTime.ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    lb_titleTime.Text        = "昨天之前数据,不可查看!";
                    lb_titleTime.ForeColor   = System.Drawing.Color.Red;
                    lb_titleName.Text        = "";
                    lb_titleTimeSX.Text      = "";
                    lb_cityWeather.Text      = "";
                    p_timeInterval.Visible   = false;
                    p_text.Visible           = false;
                    p_noExistStation.Visible = false;
                    mRData = null;
                }
            }
        }
    }
Beispiel #5
0
 protected void trProgram_SelectedNodeChanged(object sender, EventArgs e)
 {
     if (trProgram.SelectedNode != null && trProgram.SelectedNode.Parent != null)
     {
         string   oldName   = trProgram.SelectedNode.Text.Trim();
         string   oldNameID = trProgram.SelectedNode.Value.Trim();
         string[] temp      = oldNameID.Split('#');
         string   typeID    = temp[1];
         string   programID = temp[0];
         lbTip.Text      = "已选栏目:";
         lbSelected.Text = oldName;
         initlboxDisplaySelected(programID);
         initlboxStationReal(programID);
         if (temp[2] != "-1")
         {
             ddlDataType.SelectedValue = temp[2];
             Model.RecordeData mrd = new Model.RecordeData();
             mrd.DataType = Convert.ToInt32(temp[2]);
             initDDLTimeType(mrd);
             ddlTimeType.SelectedValue = typeID;
             Model.ElementRelation eleDataType = new Model.ElementRelation();
             eleDataType.DataTypeID = Convert.ToInt32(temp[2]);
             initlboxDisplayAll(eleDataType);
             lbShowError.Text    = "";
             lbSelectedCity.Text = "已选城市列表:共" + lboxStationReal.Items.Count + "个城市!";
         }
         else
         {
         }
         bSet.Enabled = true;
     }
     else
     {
         if (trProgram.SelectedNode != null && trProgram.SelectedNode.Parent == null)
         {
             trProgram.CollapseAll();
             trProgram.SelectedNode.ExpandAll();
             lbTip.Text                = "已选频道:";
             lbSelected.Text           = trProgram.SelectedNode.Text.Trim();
             ddlTimeType.SelectedValue = "选择数据时段";
             ddlDataType.SelectedValue = "选择数据类型";
             lboxDisplaySelected.Items.Clear();
             lboxStationReal.Items.Clear();
             lbShowError.Text = "请正确选择需要操作的*栏目*";
             bSet.Enabled     = false;
         }
     }
 }
Beispiel #6
0
    public void testGetZBSX()
    {
        Model.RecordeData mrd = new Model.RecordeData();
        mrd.TimeType = 6;
        mrd.DataType = 1;



        BLL.DataBLL         dbll = new BLL.DataBLL();
        Model.RecordeData[] msr2 = dbll.getZBSX(mrd);
        for (int i = 0; i < msr2.Length; i++)
        {
            al.Add(msr2[i]);
        }
        Label1.Text = msr2.Length.ToString();
    }
Beispiel #7
0
    protected void initDDLTimeSX(Model.RecordeData par_mrd)
    {
        ddl_timeSX.Items.Clear();
        ListItem newItemTimeSX = new ListItem();

        newItemTimeSX.Text  = "选择时效";
        newItemTimeSX.Value = "选择时效";
        ddl_timeSX.Items.Add(newItemTimeSX);
        if (ddl_tt.SelectedValue == "选择数据时段")
        {
            return;
        }
        else
        {
            if (lb_titleTime.Text == "昨天之前数据,不可查看!" || lb_noExistStation.Text == "本次查询无数据显示!" || lb_noExistStation.Text == "该栏目还没有进行配置!")
            {
                return;
            }
            else
            {
                try
                {
                    mTimeSXInfo = dbll.getZBSX(par_mrd);
                }
                catch
                {
                    mTimeSXInfo = null;
                }

                if (mTimeSXInfo != null && mTimeSXInfo.Length != 0)
                {
                    int countSX = mTimeSXInfo.Length;
                    for (int i = 0; i < countSX; i++)
                    {
                        ListItem newItem = new ListItem();
                        newItem.Text  = mTimeSXInfo[i].Time.ToString();
                        newItem.Value = mTimeSXInfo[i].Time.ToString();
                        ddl_timeSX.Items.Add(newItem);
                    }
                }
                else
                {
                    return;
                }
            }
        }
    }
Beispiel #8
0
    protected void ddlTimeTypeDataBind(string dataTypeID)
    {
        ddlTimeType.Items.Clear();

        Model.RecordeData dataType = new Model.RecordeData();
        dataType.DataType = Convert.ToInt32(dataTypeID);

        Model.RecordeData[] mTimeType = dbll.getTimeType(dataType);
        for (int i = 0; i < mTimeType.Length; i++)
        {
            ListItem liTimeType = new ListItem();
            liTimeType.Value = mTimeType[i].TimeType.ToString();
            liTimeType.Text  = mTimeType[i].TimeTypeName;
            ddlTimeType.Items.Add(liTimeType);
        }

        ddlTimeType.Items.Insert(0, new ListItem("-- 请选择 --", "-1"));
    }
Beispiel #9
0
    protected void ddlDataType_SelectedIndexChanged(object sender, EventArgs e)
    {
        string dataTypeID = ddlDataType.SelectedValue;

        if (dataTypeID == "选择数据类型")
        {
            lboxDisplayAll.Items.Clear();
            return;
        }
        else
        {
            Model.RecordeData     dataType    = new Model.RecordeData();
            Model.ElementRelation eleDataType = new Model.ElementRelation();
            dataType.DataType      = Convert.ToInt32(dataTypeID);
            eleDataType.DataTypeID = Convert.ToInt32(dataTypeID);
            initDDLTimeType(dataType);
            initlboxDisplayAll(eleDataType);
            lboxDisplaySelected.Items.Clear();
        }
    }
Beispiel #10
0
    protected void initDDLTimeType(Model.RecordeData mrd)
    {
        ddl_tt.Items.Clear();
        ListItem li = new ListItem();

        li.Value = "选择数据时段";
        li.Text  = "选择数据时段";
        ddl_tt.Items.Add(li);
        if (ddl_dt.SelectedValue == "选择数据类型")
        {
            return;
        }
        mTimeType = dbll.getTimeType(mrd);
        for (int i = 0; i < mTimeType.Length; i++)
        {
            ListItem liTimeType = new ListItem();
            liTimeType.Value = mTimeType[i].TimeType.ToString();
            liTimeType.Text  = mTimeType[i].TimeTypeName;
            ddl_tt.Items.Add(liTimeType);
        }
    }
Beispiel #11
0
    protected void fillGV(GridView gvShow, Model.RecordeData par_mrd, string timeSXID)
    {
        gvShow.DataSource = null;
        if (timeSXID == "选择时效")
        {
            try
            {
                mRecordeData = dbll.getZBData(par_mrd);
            }
            catch
            {
                mRecordeData = null;
            }
        }
        else
        {
            try
            {
                mRecordeData = dbll.getZBDataBySX(par_mrd);
            }
            catch
            {
                mRecordeData = null;
            }
        }
        if (mRecordeData != null && mRecordeData.Length != 0)
        {
            try//20090813byHan
            {
                showTip(mRecordeData[0]);
                if (lb_titleTime.Text == "昨天之前数据,不可查看!")
                {
                    gvShow.DataSource = null;
                }
                else
                {
                    gvShow.DataSource = mRecordeData;
                    Model.ChannelProgram mcp = new Model.ChannelProgram();
                    mcp.DataTypeID = par_mrd.DataType;
                    mcp.TimeTypeID = par_mrd.TimeType;
                    string cpid = dbll.getZBcpid(mcp).CP_ID.ToString();

                    if (mStationRelation == null)
                    {
                        mStationRelation = dbll.getZBStations(mcp);
                    }

                    if (mElementRelation == null)
                    {
                        mElementRelation = dbll.getElementsName(cpid);
                    }

                    if (alTransCode.Count == 0)
                    {
                        alTransCode = transCodeArrayList(cpid);
                    }

                    string rt = mRecordeData[0].ReportTime + "";


                    noExistStation();

                    mRecordeData_Pre = dbll.getZBDataPre(par_mrd, rt);

                    cmpCurTemPre();
                }
            }
            catch { }
        }

        else
        {
            if (mRecordeData == null)
            {
                p_noExistStation.Visible    = true;
                lb_noExistStation.Text      = "该栏目还没有进行配置!";
                lb_noExistStation.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                p_noExistStation.Visible    = true;
                lb_noExistStation.Text      = "本次查询无数据显示!";
                lb_noExistStation.ForeColor = System.Drawing.Color.Red;
            }
        }
        gvShow.DataBind();
    }
Beispiel #12
0
    protected void ddl_tt_SelectedIndexChanged(object sender, EventArgs e)
    {
        //20120830 syy 增加最高温最低温相等提示
        ////////////////////////////////////////////////
        //20130701 增加信息提示部分,包括天气现象、温度差异等等
        //////////////////////////////////////////////////
        initTipInfo();

        string dataTypeID = ddl_dt.SelectedValue;
        string timeTypeID = ddl_tt.SelectedValue;

        mRecordeData = null;
        alTransCode.Clear();
        mStationRelation       = null;
        mTimeSXInfo            = null;
        mElementRelation       = null;
        lb_titleTime.Text      = "";
        lb_noExistStation.Text = "";
        Model.RecordeData par_mrd = new Model.RecordeData();
        if (timeTypeID == "选择数据时段")
        {
            p_text.Visible           = true;
            p_noExistStation.Visible = false;
            p_tip.Visible            = false;
            gv_citydata.DataSource   = null;
            gv_citydata.DataBind();
            p_gv.Visible = false;
            initDDLTimeSX(par_mrd);
            p_print.Visible        = false;
            p_timeInterval.Visible = false;
        }
        else
        {
            try//20090814byHan
            {
                par_mrd.DataType = Convert.ToInt32(dataTypeID);
                par_mrd.TimeType = Convert.ToInt32(timeTypeID);
                fillGV(gv_citydata, par_mrd, "选择时效");

                ////20120830 syy 增加最高温最低温相等提示
                //if (equalMaxMinTemStationName != null && equalMaxMinTemStationName.Count != 0)
                //{
                //    string equalMaxMinTemStationNameStr = "";
                //    foreach (DictionaryEntry de in equalMaxMinTemStationName)
                //    {
                //        equalMaxMinTemStationNameStr += de.Key + ",";
                //    }
                //    lb_equalMaxMinTemTip.Text = "最高温度和最低温度相等的城市有:" + equalMaxMinTemStationNameStr.Substring(0, equalMaxMinTemStationNameStr.Length - 1);
                //}

                //////////////////////////////////////////////////////////////////////////////////
                //private string equalTemMessage = "最高温和最低温一致的城市:";
                //private string hlTemMessage = "异常气温(最高温>=45℃,最低温<=-40℃)的城市:";
                //private string subTemMessage = "最高气温或者最低气温和前一天预报相差>=8℃的城市:";
                //private string lTemWethMessage = "最低气温>5℃,但天气现象为冻雨、雨夹雪、小雪、中雪、大雪、暴雪的城市:";
                //private string windNMessage = "有风力(>=3级),但无风向";
                //private string wethExpMessage = "天气现象为大暴雨、大暴雪";
                ////////////////////////////////////////////////////////////////////////////////

                showTipInfo();


                p_text.Visible = false;
                if (lb_titleTime.Text != "昨天之前数据,不可查看!" && lb_noExistStation.Text != "本次查询无数据显示!" && lb_noExistStation.Text != "该栏目还没有进行配置!")
                {
                    initDDLTimeSX(par_mrd);
                    lb_titleName.Text        = ddl_dt.SelectedItem.Text.Trim() + " 类型数据  " + ddl_tt.SelectedItem.Text.Trim();
                    lb_titleTimeSX.Text      = "全部时效";
                    p_gv.Visible             = true;
                    p_timeInterval.Visible   = false;
                    p_noExistStation.Visible = true;
                    p_print.Visible          = true;
                    p_tip.Visible            = true;
                    ddl_timeSX.Enabled       = true;
                    if (mRecordeData[0].DataType == 4 || mRecordeData[0].DataType == 9)
                    {
                        ddl_timeSX.Enabled  = false;
                        lb_titleTimeSX.Text = "";
                    }
                }
                else
                {
                    ddl_timeSX.Items.Clear();
                    ListItem newItemTimeSX = new ListItem();
                    newItemTimeSX.Text  = "选择时效";
                    newItemTimeSX.Value = "选择时效";
                    ddl_timeSX.Items.Add(newItemTimeSX);
                    p_timeInterval.Visible = false;
                    p_print.Visible        = false;
                    if (lb_titleTime.Text == "昨天之前数据,不可查看!")
                    {
                        p_tip.Visible            = true;
                        p_noExistStation.Visible = false;
                    }
                    else
                    {
                        p_tip.Visible            = false;
                        p_noExistStation.Visible = true;
                    }
                }
            }
            catch { }
        }
    }