コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MCSTreeControl tr_Category = (MCSTreeControl)pl_detail.FindControl("PDT_ProductExtInfo_Category");

        if (!Page.IsPostBack)
        {
            ViewState["ID"]       = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["Category"] = Request.QueryString["Category"] == null ? 0 : int.Parse(Request.QueryString["Category"]);

            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            else
            {
                if (tr_Category != null && (int)ViewState["Category"] > 0)
                {
                    tr_Category.SelectValue = ViewState["Category"].ToString();
                }
            }
        }

        if (tr_Category != null)
        {
            tr_Category.DataSource = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);
            tr_Category.DataBind();
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ddl_Brand = (DropDownList)pl_detail.FindControl("PDT_Product_Brand");

        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            if ((int)Session["OwnerType"] == 2)
            {
                ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=1");
                ddl_Brand.DataValueField = "ID";
                ddl_Brand.DataTextField  = "Name";
                ddl_Brand.DataBind();
            }

            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["Brand"] != null && Request.QueryString["Brand"] != "0")
                {
                    ddl_Brand.SelectedValue = Request.QueryString["Brand"];
                    ddl_Brand.Enabled       = false;
                }
                MCSTabControl1.Visible = false;
            }
        }

        MCSTreeControl tr_Category = (MCSTreeControl)pl_detail.FindControl("PDT_Product_Category");

        if (tr_Category != null)
        {
            tr_Category.DataSource = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);
            tr_Category.DataBind();
        }
    }