Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.IsPostBack)
            {
                return;
            }
            this.DropExclosionType.Attributes.Add("onchange", "javascript:exclosionTpye(this.options[this.selectedIndex].value);");
            string str = BasePage.RequestString("Action", "Add");

            this.HdnAction.Value = str;
            if (!(str == "Modify"))
            {
                return;
            }
            CollectionExclosionInfo infoById = new CollectionExclosionInfo();
            int id = BasePage.RequestInt32("ExclosionID");

            if (id == 0)
            {
                AdminPage.WriteErrMsg("<li>ExclosionID 为零 或没有参数!</li>");
            }
            infoById = CollectionExclosion.GetInfoById(id);
            if (infoById.IsNull)
            {
                AdminPage.WriteErrMsg("<li>所属采集排除项目不存在!</li>");
            }
            this.TxtExclosionName.Text           = infoById.ExclosionName;
            this.DropExclosionType.SelectedValue = infoById.ExclosionType.ToString();
            this.HdnExclosionName.Value          = infoById.ExclosionName;
            switch (infoById.ExclosionType)
            {
            case 1:
                if (infoById.ExclosionStringType != 1)
                {
                    this.RadExclosionString2.Checked = true;
                    break;
                }
                this.RadExclosionString1.Checked = true;
                break;

            case 2:
                if (infoById.IsExclosionDesignatedDateTime)
                {
                    this.ChkExclosionDateTime1.Checked = true;
                    this.ExclosionDateTime1.Text       = infoById.ExclosionDesignatedDateTime.ToString();
                }
                if (infoById.IsExclosionMaxDateTime)
                {
                    this.ChkExclosionDateTime2.Checked = true;
                    this.ExclosionDateTime2.Text       = infoById.ExclosionMaxDateTime.ToString();
                }
                if (infoById.IsExclosionMinDateTime)
                {
                    this.ChkExclosionDateTime3.Checked = true;
                    this.ExclosionDateTime3.Text       = infoById.ExclosionMinDateTime.ToString();
                }
                goto Label_024C;

            case 3:
                if (infoById.IsExclosionDesignatedNumber)
                {
                    this.ChkExclosionNumber1.Checked = true;
                    this.TxtExclosionNumber1.Text    = infoById.ExclosionDesignatedNumber.ToString();
                }
                if (infoById.IsExclosionMaxNumber)
                {
                    this.ChkExclosionNumber2.Checked = true;
                    this.TxtExclosionNumber2.Text    = infoById.ExclosionMaxNumber.ToString();
                }
                if (infoById.IsExclosionMinNumber)
                {
                    this.ChkExclosionNumber3.Checked = true;
                    this.TxtExclosionNumber3.Text    = infoById.ExclosionMinNumber.ToString();
                }
                goto Label_024C;

            default:
                goto Label_024C;
            }
            this.TxtExclosionString.Text = infoById.ExclosionString;
Label_024C:
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Init", "<script type='text/javascript'>exclosionTpye(" + infoById.ExclosionType.ToString() + ");</script>");
        }