indexcode

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using BLL.DAL;
namespace GKXX
{
    public partial class index : PageBase
    {
        resourceDAL rd = new resourceDAL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetFLASH();
                tegongbind();
                hotbind();
                ttbind();
                jpbeikebind();
                schoolbind();
                newsbind();
                haotibind();
            }

}
        private void GetFLASH()
        {
            string hidImg = "";
            string hidUrl = "";
            string hidTitle = "";
            StringBuilder sb = new StringBuilder();
            page_flashDAL pd = new page_flashDAL();

DataSet ds = pd.GetList("pageid=‘1‘ order by res_up_time desc");
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    hidImg += "http://swf.gkxx.com" + row["imageurl"].ToString() + "|";
                    hidUrl += row["linkurl"].ToString() + "|";
                    hidTitle += row["title"].ToString() + "|";
                }
            }
            ViewState["flashImg"] = hidImg.TrimEnd(‘|‘);
            ViewState["imgUrl"] = hidUrl.TrimEnd(‘|‘);
            ViewState["flash_title"] = hidTitle.TrimEnd(‘|‘);
        }
        //校长访谈
        private void tegongbind()
        {
            page_bk_ggDAL gd = new page_bk_ggDAL();
            DataSet ds = gd.GetList(10, "pageid=1 and bkid=1", "res_up_time desc");
            repbind(Reptegong, ds);
        }
        //高考热点
        private void hotbind()
        {
            DataSet ds = rd.GetListSmaill(10, "ishot=1", "res_up_time desc");
            repbind(rephot, ds);
        }
        //大推荐
        protected string GetBigTj(int bkid, int top)
        {
            StringBuilder sb = new StringBuilder();
            page_tjDAL tj = new page_tjDAL();
            string big = tj.GetBig(top, bkid);
            sb.Append(big);
            return sb.ToString();
        }
        //小推荐
        protected string GetSmallTj(int bkid, int top)
        {
            StringBuilder sb = new StringBuilder();
            page_tjDAL tj = new page_tjDAL();          
            DataSet ds = tj.GetList(top, "pageid=‘1‘ and bkid=‘" + bkid + "‘ and isbig=0", "res_up_time desc");
            if (ds.Tables[0].Rows.Count > 0)
            {

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    sb.Append("<li>" + ds.Tables[0].Rows[i]["c_html"].ToString() + "</li>");

}
            }
            return sb.ToString();
        }
        //高一,高二,高三试题小标题
        private void ttbind()
        {
            DataSet ds = rd.GetListSmaill(5, "res_type=11 and res_grade=3 and isgood=1", "res_up_time desc");
            repbind(Reptt3, ds);
            ds = rd.GetListSmaill(5, "res_type=11 and res_grade=2 and isgood=1", "res_up_time desc");
            repbind(Reptt2, ds);
            ds = rd.GetListSmaill(5, "res_type=11 and res_grade=1 and isgood=1", "res_up_time desc");
            repbind(Reptt1, ds);
        }
        //精品资源每一个小标题
        private void jpbeikebind()
        {
            DataSet ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=4", "res_up_time desc");
            repbind(repjpkejian, ds);
            ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=6", "res_up_time desc");
            repbind(repjpjiaoan, ds);
            ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=7", "res_up_time desc");
            repbind(repjpxuean, ds);
            ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=8", "res_up_time desc");
            repbind(repjptongbu, ds);
            ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=9", "res_up_time desc");
            repbind(repjpsucai, ds);
            ds = rd.GetListSmaill(7, "res_type=12 and istj=1 and res_class=10", "res_up_time desc");
            repbind(repjplunwen, ds);
           
        }
        //名校展示,名校校长
        private void schoolbind()
        {
            FamousSchoolDAL fsd = new FamousSchoolDAL();
            DataSet ds = fsd.GetList(20, "is_tj=1", "addtime desc");
            repbind(repimgschool, ds);
            ds = fsd.GetList(42, "", "addtime desc");
            repbind(repschool, ds);
            ChancellorDAL cd = new ChancellorDAL();
            ds = cd.GetList(3, "", "addtime desc");
            repbind(repxiaozhang, ds);
        }
        //校长专栏,教学总结,高考政策,学习方法,更小类标题
        private void newsbind()
        {
            DataSet ds = rd.GetListSmaill(7, "res_type=3 and res_class=13", "res_up_time desc");
            repbind(repzhuanlan, ds);
            ds = rd.GetListSmaill(7, "res_type=3 and res_class=17", "res_up_time desc");
            repbind(repzongjie, ds);
            ds = rd.GetListSmaill(7, "res_type=3 and res_class=1", "res_up_time desc");
            repbind(repzhengce, ds);
            ds = rd.GetListSmaill(7, "res_type=3 and res_class=2", "res_up_time desc");
            repbind(repfangfa, ds);
        }
        //不可错过的考题
        private void haotibind()
        {
            DataSet ds = rd.GetListSmaill(11, "istj=1 and res_type=11", "res_up_time desc");
            repbind(rephaoti, ds);
        }
        //合作链接
        protected string GetLinks()
        {
            StringBuilder sb = new StringBuilder();
            linksDAL ld = new linksDAL();
            DataSet ds = ld.GetList("pageid=1");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    sb.Append("<a href=‘" + ds.Tables[0].Rows[i]["linkurl"].ToString() + "‘ target=\"_blank\">" + ds.Tables[0].Rows[i]["linkname"].ToString() + "</a>");
                }
            }
            return sb.ToString();
        }
        #region 循环出首页备课导航
        protected string GetBeikeUrl()
        {
            StringBuilder sb = new StringBuilder();
            resource_beikeDAL bd = new resource_beikeDAL();
            DataSet ds = bd.GetList("parentid=0");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 1; i <= ds.Tables[0].Rows.Count; i++)
                {
                    if (i == 1)
                    {
                        sb.Append(" <div class=\"navtxt\" id=\"xk_navtxt" + i.ToString() + "\">\n");
                    }
                    else
                    {
                        sb.Append(" <div class=\"navtxt\" id=\"xk_navtxt" + i.ToString() + "\" style=\"display:none;\">\n");
                    }
                    int sid = int.Parse(ds.Tables[0].Rows[i - 1]["id"].ToString());
                    sb.Append(Getbanben(sid));
                    sid = resource_subjectDAL.GetSubID(sid);
                    //sb.Append(GetTopic(sid));
                    sb.Append(shitiType(sid));
                    sb.Append("</div>\n");

}
            }
            return sb.ToString();
        }
        private string Getbanben(int parentid)//版本
        {
            StringBuilder sb = new StringBuilder();
            resource_beikeDAL bd = new resource_beikeDAL();
            DataSet ds = bd.GetList("parentid=" + parentid + "");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int tid = int.Parse(ds.Tables[0].Rows[i]["id"].ToString());
                    string typename = ds.Tables[0].Rows[i]["typename"].ToString();
                    sb.Append("<div class=\"nlist\">\n");
                    sb.Append("<div class=\"banben\"><a href=\"/beike/banben_" + tid + ".html\" target=\"_blank\">" + typename + "</a></div><div class=\"gradenav\">" + GetGrade(tid) + "</div>");
                    sb.Append("</div>\n");

}
            }
            return sb.ToString();
        }
        private string GetGrade(int parentid)
        {
            StringBuilder sb = new StringBuilder();
            resource_beikeDAL bd = new resource_beikeDAL();
            DataSet ds = bd.GetList("parentid=" + parentid + "");
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int gid = int.Parse(ds.Tables[0].Rows[i]["id"].ToString());
                    string typename = ds.Tables[0].Rows[i]["typename"].ToString();
                    sb.Append("<div class=\"gradetxt\"><span><a href=\"/beike/grade_" + gid + ".html\" target=\"_blank\">" + Text.Left(typename, 12) + "</a></span> \n");
                    sb.Append(GetResType(gid));
                    sb.Append("</div>");

}
            }
            return sb.ToString();
        }
        private string GetResType(int parentid)
        {
            StringBuilder sb = new StringBuilder();
            resource_child_dboDAL cd = new resource_child_dboDAL();
            DataSet ds = cd.GetList(5, "chlid_type=1", "id");
            if (ds.Tables[0].Rows.Count > 0)
            {
                string typename = "";
                int id = 0;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    typename = ds.Tables[0].Rows[i]["child_name"].ToString();
                    id = int.Parse(ds.Tables[0].Rows[i]["id"].ToString());
                    sb.Append("<a href=\"/beike/List_" + parentid + "_" + id + "_1.html\" target=\"_blank\">" + Text.Left(typename, 4) + "</a>");
                }
            }
            return sb.ToString();
        }
        private string GetTopic(int sid)
        {
            string subname = BLL.DAL.resource_subjectDAL.GetTypeName(sid);
            StringBuilder sb = new StringBuilder();
            resource_topicDAL td = new resource_topicDAL();
            DataSet ds = td.GetList("sid=‘" + sid + "‘");
            if (ds.Tables[0].Rows.Count > 0)
            {

sb.Append("<div class=\"navcon_zt\">");
                //sb.Append(" <hr />");
                sb.Append("<p class=‘zt_title‘>" + subname + "专题</p><p>");
                //sb.Append("<div class=\"nlist\"><ul><li>");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int topicid = int.Parse(ds.Tables[0].Rows[i]["id"].ToString());
                    string typename = ds.Tables[0].Rows[i]["typename"].ToString();

sb.Append("<a href=‘/topiclist.aspx?topicid=" + topicid + "‘ target=‘_blank‘>" + typename + "</a>");

}
                //sb.Append("</li></ul></div></div>");
                sb.Append("</p></div>");
            }
            return sb.ToString();
        }
        private string shitiType(int sid)
        {

StringBuilder sb = new StringBuilder();
            resource_typeDAL td = new resource_typeDAL();
            DataSet ds = td.GetList("parentid=‘1‘");
            if (ds.Tables[0].Rows.Count > 0)
            {

sb.Append("<div class=\"navcon_zt\">");
                //sb.Append("<hr />");
                sb.Append("<p class=‘zt_title‘>试题分类</p><p>");
                //sb.Append("<div class=\"nlist\"><ul><li>");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int id = int.Parse(ds.Tables[0].Rows[i]["id"].ToString());
                    string typename = ds.Tables[0].Rows[i]["word"].ToString();

sb.Append("<a href=‘search/search.html?t=1&s=" + sid + "&c=" + id + "‘ target=‘_blank‘>" + typename + "</a>");

}
                // sb.Append("</li></ul></div></div>");
                sb.Append("</p></div>");

}
            return sb.ToString();
        }
        #endregion
        private void repbind(Repeater rep, DataSet ds)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                rep.DataSource = ds;
                rep.DataBind();
            }
        }
    }
}

时间: 2024-11-10 00:18:32

indexcode的相关文章

oracle 常用语句

1.decode 函数(小版本的case when) select  decode(pd.discount_id,null,'','购买'||pd.product_count||'个,'||pd.product_discount_rate||'折优惠') as discount from b2b_product d right join b2b_product_hot ph on d.product_id = ph.product_id  left join b2b_dictionary aon

2014第20周一

周一下班回来感觉很累,多次犯了非智力错误:更新表和存储过程弄错数据库服务器,清理数据弄错数据库服务器和数据库,修改代码犯错位置,还有在尝试到问同事能很快解决问题后我渐渐变懒了,很多问题自己不愿主动深入思考就问同事,多了自然也让别人很烦:越来越感觉到在开发在工作中,明确问题是什么,主动积极专注进而避免犯非智力错误的思考真的很重要. 今天明确了Java中uuid和原来indexCode间的区别,如果不要业务规则唯一编码,简单的uuid就完全可以满足要求. 突然想到自己已坚持写了两年多,源自于想到我开

Bootstrap Table的使用小结

1.Jquery中的一些东西学习一下子,补充完善一下,毕竟有些时候没有使用到 这个方式很有用,在使用bootstrap table的时候,选择当前已经选择的节点的事件中的ID的值 当前rows中有很多的数据,但是我只需要id这一个值,这个时候进行操作就非常的简单了. $.map(data,function(item,index){return XXX}) 使用的总结: 把一个数组,按照新的方式进行组装返回,和原来的数组不一样. 遍历data数组中的每个元素,并按照return中的计算方式 形成一

ThinkPhp调用webservice

模板页: 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Insert title here</title> 6 <script type="text/javascript" src="../Public/jquery-1.8.0.min.js"></script&g

PropertyGrid控件 分类(Category)及属性(Property)排序

最近在做表单设计器,设计器上的控件都是我们自己封装的,但每个属性类别里的属性是按照属性的拼音排序的,现在想按照PropertyIndex标识进行排序(PropertyIndex的后三位是用来标识编辑器的). 具体实现如下: using System; using System.Collections.Generic; using System.Text; using System.Reflection; using System.ComponentModel; using HC.Test.Com

java File文件操作共用方法整理

package org.jelly.util; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.i

php读取excel文档内容(转载)

入到数据库的需要,php-excel-reader可以很轻松的使用它读取excel文件,本文将详细介绍,需要了解的朋友可以参考下 php开发中肯定会遇到将excel文件内容导入到数据库的需要,php-excel-reader是一个读取excel的类,可以很轻松的使用它读取excel文件非常方便. php-excel-reader下载地址: http://www.jb51.net/codes/67223.html 我下载的是php-excel-reader-2.21版本,使用的时候还遇到几个小问题

文字拼音互转

类库: /// <summary> /// 获取汉字的首字母和全拼 /// </summary> public class ChineseCode { protected string _CnTxt; protected string _EnTxt; /// <summary> /// 要获取字母的汉字 /// </summary> public string CnTxt { get { return _CnTxt; } set { _CnTxt = val

C++学习(20)

1 //图书馆信息-公有继承举例 2 //图书馆有两种类型的资料:一种是图书,一种是杂志. 3 //图书和杂志有一些共同的地方,因此可以设计一个资料类作为它们的基类. 4 //资料类的成员变量包括名字和条码. 5 //图书类的成员变量除继承基类的名字和条码外,还包括作者和内部分类号 6 //杂志类的成员变量除继承基类的名字和条码外,还包括卷号 7 #include<iostream.h> 8 #include<string.h> 9 10 //资料类 11 class Retrie