示例#1
0
    private void ExpandNode()
    {
        DataTable _fullpath = TreeTableBLL.GetFullPath("MCS_Pub.dbo.PDT_Category", "ID", "SuperID", (int)ViewState["ID"]);

        for (int i = 0; i < _fullpath.Rows.Count; i++)
        {
            int _id = int.Parse(_fullpath.Rows[i]["ID"].ToString());
            if (_id != 1)
            {
                string _valuepath = "";
                for (int j = 0; j <= i; j++)
                {
                    _valuepath += _fullpath.Rows[j]["ID"].ToString() + "/";
                }
                _valuepath = _valuepath.Substring(0, _valuepath.Length - 1);

                TreeNode node = tr_List.FindNode(_valuepath);
                if (node != null)
                {
                    if (node.ChildNodes.Count == 0)
                    {
                        BindTree(node.ChildNodes, _id);
                    }
                    node.Expand();

                    node.Selected = true;
                }
            }
        }
    }
    protected void ddl_Brand_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (tr_OrganizeCity.SelectValue != "0")
        {
            DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));

            string citys = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                citys += dt.Rows[i]["ID"].ToString();

                if (i < dt.Rows.Count - 1)
                {
                    citys += ",";
                }
            }
            string condition = "ToOrganizeCity IN (" + citys + ") AND GETDATE() BETWEEN BeginTime AND DateAdd(day,1,EndTime) AND State=2 AND Type=" + rbl_Type.SelectedValue + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',1)=" + ddl_Brand.SelectedValue;
            IList <ORD_ApplyPublish> list = ORD_ApplyPublishBLL.GetModelList(condition);
            ddl_Publish.DataTextField  = "Topic";
            ddl_Publish.DataValueField = "ID";
            ddl_Publish.DataSource     = list;
            ddl_Publish.DataBind();
            if (list.Count == 0)
            {
                ddl_Publish.Items.Insert(0, new ListItem("当前无可以申请的产品目录", "0"));
                bt_Confirm.Enabled = false;
            }
            else
            {
                bt_Confirm.Enabled = true;
            }
        }
    }
    protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        #region 限定选择提成计算方法的范围只能是当前片区
        DropDownList ddl_SalaryGrade = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_SalaryGrade");
        if (ddl_SalaryGrade != null)
        {
            try
            {
                ddl_SalaryGrade.DataTextField  = "Name";
                ddl_SalaryGrade.DataValueField = "ID";

                string    orgcitys = "";
                DataTable dt       = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["ID"].ToString() != "")
                    {
                        orgcitys += "," + dr["ID"].ToString();
                    }
                }
                if (orgcitys.Length > 1)
                {
                    orgcitys = orgcitys.Substring(1, orgcitys.Length - 1);
                }

                ddl_SalaryGrade.DataSource = PM_SalaryLevelBLL.GetModelList("OrganizeCity in (" + orgcitys + ")");
                ddl_SalaryGrade.DataBind();
            }
            catch { }
            ddl_SalaryGrade.Items.Insert(0, new ListItem("请选择", "0"));
        }
        #endregion
    }
示例#4
0
    private void ExpandNode()
    {
        int SuperID = int.Parse(Request.QueryString["SuperID"]);

        DataTable _fullpath = TreeTableBLL.GetFullPath("Addr_OfficialCity", "ID", "SuperID", SuperID);

        for (int i = 0; i < _fullpath.Rows.Count; i++)
        {
            int _id = int.Parse(_fullpath.Rows[i]["ID"].ToString());
            if (_id != 1)
            {
                string _valuepath = "";
                for (int j = 0; j <= i; j++)
                {
                    _valuepath += _fullpath.Rows[j]["ID"].ToString() + "/";
                }
                _valuepath = _valuepath.Substring(0, _valuepath.Length - 1);
                BindTree(tr_List.FindNode(_valuepath).ChildNodes, _id);
                tr_List.FindNode(_valuepath).Expand();
            }
        }
    }
    private void BindPublish()
    {
        if (tr_OrganizeCity.SelectValue != "0")
        {
            DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));

            string citys = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                citys += dt.Rows[i]["ID"].ToString();

                if (i < dt.Rows.Count - 1)
                {
                    citys += ",";
                }
            }

            if (rbl_Type.SelectedValue == "1")
            {
                ddl_OrderType.DataSource     = DictionaryBLL.GetDicCollections("ORD_ProductOrderType");
                ddl_OrderType.DataTextField  = "Value";
                ddl_OrderType.DataValueField = "Key";
                ddl_OrderType.DataBind();
                rbl_IsSpecial.DataSource = DictionaryBLL.GetDicCollections("PUB_YesOrNo");
                rbl_IsSpecial.DataBind();
                rbl_IsSpecial.SelectedValue = "2";

                IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("IsOpponent=1");
                ddl_Brand.DataTextField  = "Name";
                ddl_Brand.DataValueField = "ID";
                ddl_Brand.DataSource     = _brandList;
                ddl_Brand.DataBind();
                ddl_Brand_SelectedIndexChanged(null, null);
            }
        }
    }