protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["Category"] = Request.QueryString["Category"] != null?int.Parse(Request.QueryString["Category"]) : 0;

            BindDropDown();

            DataTable dt = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"], "");
            BindTree(dt, tr_List.Nodes, 0);

            if ((int)ViewState["Category"] != 0)
            {
                ExpandNode();
            }

            BindGrid();
        }

        string script = "function PopMore(id){\r\n";

        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("Pop_SelectMoreProduct.aspx") +
                  "?tempid='+tempid, window, 'dialogWidth:900px;DialogHeight=650px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopMore", script, true);
    }
    private void BindDropDown()
    {
        if ((int)Session["OwnerType"] == 3)
        {
            if (ddl_FitSalesArea != null)
            {
                ddl_FitSalesArea.DataTextField  = "Name";
                ddl_FitSalesArea.DataValueField = "ID";
                ddl_FitSalesArea.DataSource     = CM_RTSalesArea_TDPBLL.GetRTSalesArea_ByTDP((int)Session["OwnerClient"]);
                ddl_FitSalesArea.DataBind();
                ddl_FitSalesArea.Items.Insert(0, new ListItem("不限区域", "0"));
            }

            if (ddl_FitRTChannel != null)
            {
                ddl_FitRTChannel.DataTextField  = "Name";
                ddl_FitRTChannel.DataValueField = "ID";
                ddl_FitRTChannel.DataSource     = CM_RTChannel_TDPBLL.GetRTChannel_ByTDP((int)Session["OwnerClient"]);
                ddl_FitRTChannel.DataBind();
                ddl_FitRTChannel.Items.Insert(0, new ListItem("不限渠道", "0"));
            }
        }

        tr_Category.DataSource = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);
        tr_Category.DataBind();
        tr_Category.SelectValue = "1";
    }
Beispiel #3
0
    private void BindDropDown()
    {
        DataTable dt = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);

        tree_SuperID.DataSource = dt;
        tree_SuperID.DataBind();
    }
Beispiel #4
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();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindDropDown();

            DataTable dt = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"], "");
            BindTree(dt, tr_List.Nodes, 0);

            BindGrid();
        }
    }
Beispiel #6
0
    private void BindTree(TreeNodeCollection TNC, int SuperID)
    {
        DataTable dt = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"], "");

        dt.DefaultView.RowFilter = "SuperID=" + SuperID.ToString();

        foreach (DataRowView dr in dt.DefaultView)
        {
            TreeNode tn = new TreeNode();
            tn.Text     = dr["Name"].ToString();
            tn.Value    = dr["ID"].ToString();
            tn.ImageUrl = "~/Images/gif/gif-0030.gif";
            TNC.Add(tn);
            //if (_model.ID == 1)
            BindTree(tn.ChildNodes, (int)dr["ID"]);
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["WareHouseID"] = Request.QueryString["WareHouseID"] != null?int.Parse(Request.QueryString["WareHouseID"]) : 0;

            #endregion

            BindDropDown();
            if ((int)ViewState["WareHouseID"] > 0 && ddl_WareHouse.Items.FindByValue(ViewState["WareHouseID"].ToString()) != null)
            {
                ddl_WareHouse.SelectedValue = ViewState["WareHouseID"].ToString();
            }
            DataTable dt = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"], "");
            BindTree(dt, tr_List.Nodes, 0);

            BindGrid();
        }
    }
    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();
        }
    }
 private void BindDropDown()
 {
     tr_Category.DataSource = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);
     tr_Category.DataBind();
     tr_Category.SelectValue = "1";
 }