Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Usermanager"] == null)
        {
            Response.Redirect("~/Login.aspx");
        }
        else
        {
            if (!IsPostBack)
            {
                //填充DropDownlist控件
                this.ddlCarrieCompany.DataSource     = ComMan.GetAllCarrieCompany();
                this.ddlCarrieCompany.DataTextField  = "CoName";
                this.ddlCarrieCompany.DataValueField = "Cid";
                ddlCarrieCompany.DataBind();
                //传过来的id不为空执行删除功能
                if (Request.QueryString["Rid"] != null)
                {
                    txtDate.Visible = true;
                    string     Rid  = Request.QueryString["Rid"].ToString();
                    RegisterTB Regg = new RegisterTB();
                    Regg = regMan.GetAllTBByRid(Rid);
                    ddlCarrieCompany.SelectedValue = Regg.Cid.ToString();
                    txtBeginNo.Text = Regg.BeginNo.ToString();
                    txtEndNo.Text   = Regg.EndNo.ToString();
                    txtDate.Text    = Regg.Buydate.ToString();
                    txtRemark.Text  = Regg.Remark;
                }
                //清空控件
                else
                {
                    txtDate.Visible = false;
                    txtBeginNo.Text = "";
                    txtEndNo.Text   = "";
                    txtDate.Text    = "";
                    txtRemark.Text  = "";
                }

                lblmessage.Visible = false;
                lblok.Visible      = false;
            }
        }
    }