Пример #1
0
    private void createadplacetypeshtml()
    {
        try
        {
            string str = "";
            string strlist = "";
            XYECOM.Business.AdPlaceType at = new XYECOM.Business.AdPlaceType();
            DataTable DT = at.GetDataTable("where AT_PID=0", "");
            DataTable dte = at.GetDataTable("where 1=1", "");
            if (DT.Rows.Count > 0)
            {
                for (int i = 0; i < DT.Rows.Count; i++)
                {
                    str += " <a href=\"#\" title=\"点此选择此项\" onclick=\"selecttypeinfo(" + DT.Rows[i]["AT_ID"].ToString() + ",'" + DT.Rows[i]["AT_Name"].ToString() + "');\">" + DT.Rows[i]["AT_Name"].ToString() + "</a>";
                    strlist += "<li class=\"";
                    dte.DefaultView.RowFilter = "AT_PID=" + DT.Rows[i]["AT_ID"].ToString();
                    DataView dv1 = dte.DefaultView;

                    if (dv1.Count > 0)
                        strlist += "shrink\"><a href=\"#\" onclick=\"selecttypelist(" + DT.Rows[i]["AT_ID"].ToString() + ",this);\">" + DT.Rows[i]["AT_Name"].ToString() + "</a></li>";
                    else
                        strlist += "spread\">" + DT.Rows[i]["AT_Name"].ToString() + "</li>";
                }
            }
            else
            {
                str += "";
            }
            str = str.Insert(0, strlist + "$");
            Response.Write(str);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #2
0
    private void createAdPlaceTypeHTML(int id)
    {
        try
        {
            string str = "";
            string strlist = "";
            string strWhere = "";
            XYECOM.Business.AdPlaceType at = new XYECOM.Business.AdPlaceType();
            if (id == 0)
            {
                str += "请选择广告位类别";
                strlist += "<a href=\"#\" onclick=\"selecttypelist(0,this);\">请选择广告位类别</a>";
            }
            else
            {
                strWhere = "where AT_ID=" + id;
                DataTable dt = at.GetDataTable(strWhere, "");
                if (dt.Rows.Count > 0)
                {
                    str += dt.Rows[0]["AT_Name"].ToString();
                    strlist += "<a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[0]["AT_ID"].ToString() + ",this);\">" + dt.Rows[0]["AT_Name"].ToString() + "</a>";
                }
            }

            str += "$";
            DataTable DT = at.GetDataTable("where AT_PID=" + id, "");
            DataTable dte = at.GetDataTable("where 1=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]["AT_ID"].ToString() + ",'" + DT.Rows[i]["AT_Name"].ToString() + "');\">" + DT.Rows[i]["AT_Name"].ToString() + "</a>";
                    strlist += "<li class=\"";
                    dte.DefaultView.RowFilter = "AT_PID=" + DT.Rows[i]["AT_ID"].ToString();
                    DataView dv1 = dte.DefaultView;

                    if (dv1.Count > 0)
                    {
                        strlist += "shrink\"><a href=\"#\" onclick=\"selecttypelist(" + DT.Rows[i]["AT_ID"].ToString() + ",this);\">" + DT.Rows[i]["AT_Name"].ToString() + "</a></li>";
                    }
                    else
                        strlist += "sublast\">" + DT.Rows[i]["AT_Name"].ToString() + "</li>";
                }
                strlist += "</ul>";
            }
            else
            {
                str += "";
            }
            str += "$";
            str += strlist;
            Response.Write(str);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.Replace("\n", ""));
        }
    }