Пример #1
0
 public string GetErLinkageType(string Name, string IsNotNull, string Content, string Description, DataRow dr)
 {
     string str4;
     string str = "";
     string str2 = "";
     string[] strArray = Content.Split(new char[] { ',' });
     string[] strArray2 = strArray[0].Split(new char[] { '=' });
     string[] strArray3 = strArray[2].Split(new char[] { '=' });
     DataTable dictionary = new B_Dictionary().GetDictionary(int.Parse(strArray2[1]));
     if (IsNotNull == "True")
     {
         str2 = "<font color=\"red\">*</font>";
     }
     if (dr != null)
     {
         return str;
     }
     str = ("<select name=\"select_" + Name + "\" onchange=\"GetLinkage('select_" + Name + "','select_" + strArray3[1] + "',0)\">") + "<option value=\"0\">请选择</option>";
     for (int i = 0; i < dictionary.Rows.Count; i++)
     {
         str4 = str;
         str = str4 + "<option value=\"" + dictionary.Rows[i]["Id"].ToString() + "\">" + dictionary.Rows[i]["DicName"].ToString() + "</option>";
     }
     str4 = str;
     str4 = str4 + "</select><input type=\"txt\" name=\"txt_" + Name + "\" value=\"0\" style=\"display:none\"><input type=\"txt\" name=\"txt_" + Name + "_Id\" value=\"0\" style=\"display:none\">";
     return (str4 + " <select name=\"select_" + strArray3[1] + "\" onchange=\"GetSmallLinkage('select_" + strArray3[1] + "')\"><option value=\"0\">请选择</option></select><input type=\"txt\" name=\"txt_" + strArray3[1] + "\" value=\"0\" style=\"display:none\"><input type=\"txt\" name=\"txt_" + strArray3[1] + "_Id\" value=\"0\" style=\"display:none\">" + str2 + " " + Description + "");
 }
Пример #2
0
 private void BindChType(int chType)
 {
     int ChTypeDicID = 1;
     B_Dictionary dicBll = new B_Dictionary();
     DataTable dt = dicBll.GetDictionary(ChTypeDicID);
     ddlChType.DataTextField = "dicname";
     ddlChType.DataValueField = "id";
     ddlChType.DataSource = dt.DefaultView;
     ddlChType.DataBind();
     ddlChType.Items.Add(new ListItem("其他","0"));
     dt.Dispose();
     try
     {
         ddlChType.SelectedValue = chType.ToString();
     }
     catch { }
 }
Пример #3
0
 private void BindModelList()
 {
     int chType = 1;
     B_Dictionary dictionBll = new B_Dictionary();
     DataTable chTypeDt = dictionBll.GetDictionary(chType);
     repModelList.DataSource = chTypeDt;
     repModelList.DataBind();
     chTypeDt.Dispose();
 }
Пример #4
0
    private void Bind()
    {
        int ChType = 1;
        B_Dictionary dictionBll = new B_Dictionary();
        DataTable chTypeDt = dictionBll.GetDictionary(ChType);

        for (int i = 0; i < chTypeDt.Rows.Count; i++)
        {
            TreeNode chTypeNode = new TreeNode();
            chTypeNode.ToolTip = "分类右键操作$" + chTypeDt.Rows[i]["id"].ToString();
            chTypeNode.Text = chTypeDt.Rows[i]["DicName"].ToString();
            chTypeNode.ImageUrl = "~/system/images/category.gif";
            chTypeNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=" + chTypeDt.Rows[i]["id"].ToString();
            chTypeNode.Target = "ContentIframe";
            tvNav.Nodes.Add(chTypeNode);
        }
        TreeNode chTypeOtherNode = new TreeNode();
        chTypeOtherNode.ToolTip = "分类右键操作$0";
        chTypeOtherNode.Text = "其他";
        chTypeOtherNode.ImageUrl = "~/system/images/category.gif";
        chTypeOtherNode.NavigateUrl = "~/system/info/ChannelList.aspx?ChType=0";
        chTypeOtherNode.Target = "ContentIframe";
        tvNav.Nodes.Add(chTypeOtherNode);

        B_Channel channelBll = new B_Channel();
        B_Column columnBll = new B_Column();
        DataView channelDv = channelBll.GetList(false);

        for (int i = 0; i < tvNav.Nodes.Count-1; i++)
        {
            int chType = int.Parse(chTypeDt.Rows[i]["id"].ToString());

            DataTable chDt = channelDv.ToTable();

            DataView chTypeDv = new DataView(chDt);
            chTypeDv.RowFilter=string.Format("[chtype]={0}",chType);
            for (int j = 0; j < chTypeDv.Count; j++)
            {
                TreeNode channelNode = new TreeNode();
                channelNode.ToolTip = "频道右键操作$" + chTypeDv[j]["ChId"].ToString() + "$" + chTypeDv[j]["ChType"].ToString();
                channelNode.Text = chTypeDv[j]["ChName"].ToString();
                channelNode.ImageUrl = "~/system/images/folder.gif";
                channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv[j]["ChId"];
                channelNode.Target = "ContentIframe";
                tvNav.Nodes[i].ChildNodes.Add(channelNode);
            }

            for (int j = 0; j < chTypeDv.Count; j++)
            {
                DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv[j]["ChId"]);
                DataTable dt = dv.ToTable();
                dv.Dispose();
                BindColumn(0, tvNav.Nodes[i].ChildNodes[j], dt, (int)chTypeDv[j]["ModelType"], (int)chTypeDv[j]["ChId"]);
            }
            chDt.Dispose();
            chTypeDv.Dispose();
        }
        DataTable chDt2 = channelDv.ToTable();
        DataView chTypeDv2 = new DataView(chDt2);
        chTypeDv2.RowFilter = "[chtype]=0 or [chtype] is null";
        for (int j = 0; j < chTypeDv2.Count; j++)
        {
            TreeNode channelNode = new TreeNode();
            channelNode.ToolTip = "频道右键操作$" + chTypeDv2[j]["ChId"].ToString() + "$" + chTypeDv2[j]["ChType"].ToString();
            channelNode.Text = chTypeDv2[j]["ChName"].ToString();
            channelNode.ImageUrl = "~/system/images/folder.gif";
            channelNode.NavigateUrl = "~/system/info/ColumnList.aspx?ChId=" + chTypeDv2[j]["ChId"];
            channelNode.Target = "ContentIframe";
            tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes.Add(channelNode);
        }
        for (int j = 0; j < chTypeDv2.Count; j++)
        {
            DataView dv = columnBll.GetColumnListByChannelId((int)chTypeDv2[j]["ChId"]);
            DataTable dt = dv.ToTable();
            dv.Dispose();
            BindColumn(0, tvNav.Nodes[tvNav.Nodes.Count - 1].ChildNodes[j], dt, (int)chTypeDv2[j]["ModelType"], (int)chTypeDv2[j]["ChId"]);
        }
        chDt2.Dispose();
        chTypeDv2.Dispose();
    }