Exemplo n.º 1
0
    private void createProductTypeListHTML(string moduleName)
    {
        string str = "";
        string strlist = "";
        ProductType pt = new ProductType();
        DataTable dt = pt.GetDataTable(0, moduleName);
        DataTable dt1 = pt.GetDataTable(-1);
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            str += " <li class=\"";
            strlist += "    <a href=\"#\" title=\"点击选择此项\" onclick=\"selecttypeinfo(" + dt.Rows[i]["PT_ID"].ToString() + ",'" + dt.Rows[i]["PT_Name"].ToString() + "');\">" + dt.Rows[i]["PT_Name"].ToString() + "</a>";

            dt1.DefaultView.RowFilter = "PT_ParentID=" + dt.Rows[i]["PT_ID"].ToString();
            DataView dv1 = dt1.DefaultView;
            if (dv1.Count > 0)
                str += "shrink\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["PT_ID"].ToString() + ",this);\">" + dt.Rows[i]["PT_Name"].ToString() + "</a></li>";
            else
                str += "sublast\" >" + dt.Rows[i]["PT_Name"].ToString() + "</li>";
        }

        str = str.Insert(0, strlist + "$");
        Response.Write(str);
    }
Exemplo n.º 2
0
    private void CreateProductTypeHTML(int PT_ID,string moduleName)
    {
        try
        {
            string str = "";
            string strlist = "";
            XYECOM.Business.ProductType pt = new XYECOM.Business.ProductType();
            XYECOM.Model.ProductTypeInfo et = new XYECOM.Model.ProductTypeInfo();
            if (PT_ID == 0)
            {
                str += "请选择供求类别";
                strlist += "<a href=\"#\" onclick=\"selecttypelist(0,this);\">请选择供求类别</a>";
            }
            else
            {
                et = pt.GetItem(PT_ID);

                str += et.PT_Name.ToString();
                strlist += "<a href=\"#\" onclick=\"selecttypelist(" + et.PT_ID.ToString() + ",this);\">" + et.PT_Name.ToString() + "</a>";
            }
            str += "$";
            DataTable dt = pt.GetDataTable(PT_ID, moduleName);
            DataTable dt1 = pt.GetDataTable(-1);
            if (dt.Rows.Count > 0)
            {
                strlist += " <ul class=\"subset\">";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    str += "    <a href=\"#\" title=\"点击选择此项\" onclick=\"selecttypeinfo(" + dt.Rows[i]["PT_ID"].ToString() + ",'" + dt.Rows[i]["PT_Name"].ToString() + "');\">" + dt.Rows[i]["PT_Name"].ToString() + "</a>";
                    strlist += "<li class=\"";
                    dt1.DefaultView.RowFilter = "PT_ParentID=" + dt.Rows[i]["PT_ID"].ToString();
                    DataView dv1 = dt1.DefaultView;
                    if (dv1.Count > 0)
                        strlist += "shrink\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["PT_ID"].ToString() + ",this);\">" + dt.Rows[i]["PT_Name"].ToString() + "</a></li>";
                    else
                        strlist += "sublast\" >" + dt.Rows[i]["PT_Name"].ToString() + "</li>";

                }
                strlist += "</ul>";

            }
            else
            {
                str += " ";
            }

            str += "$";

            str += strlist;
            Response.Write(str);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.Replace("\n", ""));
        }
    }