예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <Cultural.Model.Board> bList = boardBll.GetModelList(" Status!='0' ");
                ht.Clear();
                for (int i = 0; i < bList.Count; i++)
                {
                    ht.Add(bList[i].BoardID, bList[i].BoardName);
                }
                htBID.Clear();
                htBID.Add("公告", "");
                htBID.Add("中心动态", "");
                htBID.Add("闲情偶寄", "");
                htBID.Add("业界资讯", "");
                htBID.Add("服务社会", "");
                htBID.Add("合作单位", "");
                htBID.Add("友情链接", "");
                foreach (DictionaryEntry h in ht)
                {
                    htBID["公告"]   = h.Value.ToString() == "公告"?h.Key:htBID["公告"];
                    htBID["中心动态"] = h.Value.ToString() == "中心动态" ? h.Key : htBID["中心动态"];
                    htBID["闲情偶寄"] = h.Value.ToString() == "闲情偶寄" ? h.Key :htBID["闲情偶寄"];
                    htBID["业界资讯"] = h.Value.ToString() == "业界资讯" ? h.Key : htBID["业界资讯"];
                    htBID["服务社会"] = h.Value.ToString() == "服务社会" ? h.Key : htBID["服务社会"];
                    htBID["合作单位"] = h.Value.ToString() == "合作单位" ? h.Key :htBID["合作单位"];
                    htBID["友情链接"] = h.Value.ToString() == "友情链接" ? h.Key :htBID["友情链接"];
                }
            }

            repAnnounce.DataSource = infoBll.GetListByPage(string.Format(" BoardID={0} and  Status!='0' ", htBID["公告"].ToString() == "" ? "0" : htBID["公告"]), " Weight desc,PubTime desc ", 0, 9);
            repAnnounce.DataBind();

            repCenterNews.DataSource = infoBll.GetListByPage(string.Format(" BoardID={0} and  Status!='0' ", htBID["中心动态"].ToString() == "" ? "0" : htBID["中心动态"]), " Weight desc,PubTime desc ", 0, 9);
            repCenterNews.DataBind();

            repRelaxInfo.DataSource = infoBll.GetListByPage(string.Format(" (BoardID ={0} or BoardID in(select BoardID from Board where ParentID ={1}) ) and  Status!='0' ", htBID["闲情偶寄"].ToString() == "" ? "0" : htBID["闲情偶寄"], htBID["闲情偶寄"] == "" ? "0" : htBID["闲情偶寄"]), " Weight desc,PubTime desc ", 0, 8);
            repRelaxInfo.DataBind();

            repFieldInfo.DataSource = infoBll.GetListByPage(string.Format(" BoardID={0} and  Status!='0' ", htBID["业界资讯"].ToString() == "" ? "0" : htBID["业界资讯"]), " Weight desc,PubTime desc ", 0, 8);
            repFieldInfo.DataBind();

            repTrainInfo.DataSource = infoBll.GetListByPage(string.Format(" (BoardID ={0} or BoardID in(select BoardID from Board where ParentID ={1}) ) and  Status!='0' ", htBID["服务社会"].ToString() == "" ? "0" : htBID["服务社会"], htBID["服务社会"] == "" ? "0" : htBID["服务社会"]), " Weight desc,PubTime desc ", 0, 8);
            repTrainInfo.DataBind();

            repPartner.DataSource = departBll.GetListByPage(string.Format("Status!='0' and  Weight>0", htBID["合作单位"].ToString() == "" ? "0" : htBID["合作单位"]), " Weight desc ", 0, 10);
            repPartner.DataBind();

            repFriendsLink.DataSource = linkBll.GetListByPage(string.Format(" Status='2' "), " Weight desc ", 0, 20);
            repFriendsLink.DataBind();

            repImgShow.DataSource = homeImgBll.GetListByPage(" Status='2' ", " ImgID desc ", 0, 6);
            repImgShow.DataBind();
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Cultural.BLL.Department departBll = new Cultural.BLL.Department();
            context.Response.ContentType = "text/plain";
            string paraFID = context.Request["FID"];                                                                        //读取参数PageSize

            if (paraFID != null && paraFID.Trim() == "DL")                                                                  //列表界面
            {
                int        paraIndex   = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]);        //读取参数PageSize
                int        paraSize    = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize
                string     paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString();  //读取参数
                DepartInfo departInfo  = new DepartInfo();
                departInfo.DepartList = departBll.DataTableToList(departBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " Weight desc,DepartID asc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]);
                departInfo.TotalNum   = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID));
                context.Response.Write(JsonHelper.Serialize(departInfo));
            }
            if (paraFID != null && paraFID.Trim() == "DownL")                                                                             //列表界面
            {
                int                     paraIndex    = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]);        //读取参数PageSize
                int                     paraSize     = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize
                string                  paraBoardID  = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString();  //读取参数
                DownLoadInfo            downLoadInfo = new DownLoadInfo();
                Cultural.BLL.DownCenter dcBll        = new Cultural.BLL.DownCenter();
                downLoadInfo.DownCenterList = dcBll.DataTableToList(dcBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " PubTime desc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]);
                foreach (Cultural.Model.DownCenter dc in downLoadInfo.DownCenterList)
                {
                    dc.PubTime = dc.PubTime.Substring(0, 10);
                }
                downLoadInfo.TotalNum = dcBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID));
                context.Response.Write(JsonHelper.Serialize(downLoadInfo));
            }
            if (paraFID != null && paraFID.Trim() == "DownD")                                                 //详细界面
            {
                int paraIndex = context.Request["InfoID"] == null ? 0 : int.Parse(context.Request["InfoID"]); //读取参数InfoID
                Cultural.Model.DownCenter downLoad = new Cultural.Model.DownCenter();
                Cultural.BLL.DownCenter   dcBll    = new Cultural.BLL.DownCenter();
                downLoad = dcBll.GetModel(paraIndex);
                DownLoadInfo downLoadInfo = new DownLoadInfo();
                downLoadInfo.DownCenterList = new List <Cultural.Model.DownCenter>();
                downLoadInfo.DownCenterList.Add(downLoad);
                Cultural.BLL.Board   boardBll = new Cultural.BLL.Board();
                Cultural.Model.Board board    = new Cultural.Model.Board();
                board = boardBll.GetModel(int.Parse(downLoad.BoardID.ToString()));
                downLoadInfo.BName = board.BoardName;
                context.Response.Write(JsonHelper.Serialize(downLoadInfo));
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                id = GetBIDByQueryStr(Request.QueryString["BName"]);
                boardIDInfo.Value = id;
                try
                {
                    if (id != null && id.ToString().Trim() != "")
                    {
                        //取得该id的板块信息
                        Cultural.Model.Board board = new Cultural.Model.Board();
                        board = boardBll.GetModel(int.Parse(id));
                        if (board != null)
                        {
                            if (board.ParentID == 0)//为第一级板块
                            {
                                //一级板块名赋值
                                ParentBName = board.BoardName;
                                //取得所有子级板块
                                List <Cultural.Model.Board> boardList = new List <Cultural.Model.Board>();
                                boardList = boardBll.GetModelList(string.Format(" ParentID ={0} and Status!='0' ", board.BoardID));
                                //如果有子版块
                                if (boardList.Count > 0)
                                {
                                    //给页面子版块赋值
                                    repBoardList.DataSource = boardList;
                                    repBoardList.DataBind();
                                    //显示第一个板块的Infomation
                                    boardIDInfo.Value = boardList[0].BoardID.ToString();
                                    DataSet infoData = new DataSet();
                                    infoData                 = departBll.GetListByPage(string.Format(" BoardID={0} and Status!=0", boardList[0].BoardID), " Weight desc,DepartID asc ", 1, 15);
                                    boardInfoNum.Value       = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!=0", boardList[0].BoardID)).ToString();
                                    repDepartList.DataSource = infoData;
                                    repDepartList.DataBind();
                                }
                                else // 如果没有子版块
                                {
                                    //给页面子版块赋值null
                                    repBoardList.DataSource = null;
                                    repBoardList.DataBind();
                                    //显示第一个板块的Infomation
                                    DataSet infoData = new DataSet();
                                    infoData                 = departBll.GetListByPage(string.Format(" BoardID={0} and Status!=0", board.BoardID), " Weight desc,DepartID asc ", 1, 15);
                                    boardInfoNum.Value       = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!=0", board.BoardID)).ToString();
                                    repDepartList.DataSource = infoData;
                                    repDepartList.DataBind();
                                }
                            }
                            else //非一级板块
                            {
                                repDepartList.DataSource = null;
                                repDepartList.DataBind();
                            }
                        }
                        else
                        {
                            ParentBName = Request.QueryString["BName"];
                            Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n         1.网络错误\\n         2.暂时无数据\\n       请重试!");
                        }
                    }
                    else
                    {
                        ParentBName = Request.QueryString["BName"];
                        Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n         1.网络错误\\n         2.暂时无数据\\n       请重试!");
                    }
                    repAnnounce.DataSource = infoBll.GetListByPage(string.Format(" BoardID={0} and  Status!='0' ", htBID["公告"] == "" ? "0" : htBID["公告"]), " Weight desc,PubTime desc ", 0, 9);
                    repAnnounce.DataBind();

                    repRelaxInfo.DataSource = infoBll.GetListByPage(string.Format(" (BoardID ={0} or BoardID in(select BoardID from Board where ParentID ={1}) ) and  Status!='0' ", htBID["闲情偶寄"] == "" ? "0" : htBID["闲情偶寄"], htBID["闲情偶寄"] == "" ? "0" : htBID["闲情偶寄"]), " Weight desc,PubTime desc ", 0, 8);
                    repRelaxInfo.DataBind();
                }
                catch (Exception ex)
                {
                    ParentBName = Request.QueryString["BName"];
                    Maticsoft.Common.MessageBox.Show(this.Page, "可能原因:\\n         1.网络错误\\n         2.暂时无数据\\n       请重试!" + ex.Message);
                }
            }
        }