protected void RoomListInfo() { RoomSmallID = CommonManager.Web.Request("sid", ""); //Limit.getFormValue("sid"); if (RoomBigID.ToString() == "" && RoomSmallID.ToString() == "") { SqlW = ""; SqlC = ""; //para = ""; } else if (RoomBigID.ToString() != "" && RoomSmallID.ToString() == "") { SqlW = " and GamekindID='" + RoomBigID + "'"; SqlC = " and GamekindID='" + RoomBigID + "'"; para = "bid=" + RoomBigID; } else if (RoomBigID.ToString() != "" && RoomSmallID.ToString() != "") { SqlW = " and GamekindID='" + RoomBigID + "' and GameNameid='" + RoomSmallID + "'"; SqlC = " and GamekindID='" + RoomBigID + "' and GameNameid='" + RoomSmallID + "'"; para = "bid=" + RoomBigID + "&sid=" + RoomSmallID; } else if (RoomSmallID.ToString() != "") { SqlW = " and GameNameid='" + RoomSmallID + "'"; SqlC = " and GameNameid='" + RoomSmallID + "'"; para = "sid=" + RoomSmallID; } else { //Limit.outMsgBox( "温馨提示:\\n\\n请勿非法操作!", true ); CommonManager.Web.RegJs(this, "alert('请勿非法操作!');", false); return; } DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "Web_VGameRoomInfo") .AddInputParameter("@Wheres", DbType.String, SqlW) .AddInputParameter("@KeyName", DbType.String, "id") .AddInputParameter("@OrderBy", DbType.String, "id desc") .ToDataSet(); if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; RoomListInfos.DataSource = ds.Tables[1]; RoomListInfos.DataBind(); RoomListInfos.Visible = true; NoRoomListInfos.Visible = false; } else { RoomListInfos.Visible = false; NoRoomListInfos.Visible = true; } /* * DataTable sd = new DataTable(); * //string para = "bid=" + RoomBigID + "&sid=" + RoomSmallID; * string[] sql = new string[2]; * sql[0] = "select * from TGameRoomInfo as a left outer join TGameRoomBase as b on b.RoomID = a.RoomID " + SqlW + " order by ID DESC"; * sql[1] = "select count(*) from TGameRoomInfo " + SqlC + ""; * string url = "GameRooms.aspx"; * PageLink page_set = new PageLink(url, 20, 10, para, sql); * page_set.paraLinkType = paraLinkShow.middling.ToString(); * sd = page_set.get_table(); * if (sd.Rows.Count > 0) * { * Repeater VList = (Repeater)Page.FindControl("RoomListInfos"); * VList.DataSource = sd; * VList.DataBind(); * this.pageList.Text = page_set.pageList(); * } * else * this.NoRoomListInfos.Visible = true; * sd.Clear();*/ }
protected void RoomListInfo() { if (CommonManager.Web.Request("id", "") == "") { RoomSmallID = CommonManager.Web.Request("sid", "");//Limit.getFormValue("sid"); } else { RoomSmallID = CommonManager.Web.Request("id", ""); } if (RoomBigID.ToString() == "" && RoomSmallID.ToString() == "") { SqlW = ""; SqlC = ""; //para = ""; } else if (RoomBigID.ToString() != "" && RoomSmallID.ToString() == "") { SqlW = " and GamekindID='" + RoomBigID + "'"; SqlC = " and GamekindID='" + RoomBigID + "'"; para = "bid=" + RoomBigID; } else if (RoomBigID.ToString() != "" && RoomSmallID.ToString() != "") { SqlW = " and GamekindID='" + RoomBigID + "' and GameNameid='" + RoomSmallID + "'"; SqlC = " and GamekindID='" + RoomBigID + "' and GameNameid='" + RoomSmallID + "'"; para = "bid=" + RoomBigID + "&sid=" + RoomSmallID; } else if (RoomSmallID.ToString() != "") { SqlW = " and GameNameid='" + RoomSmallID + "'"; SqlC = " and GameNameid='" + RoomSmallID + "'"; para = "sid=" + RoomSmallID; } else { //Limit.outMsgBox( "温馨提示:\\n\\n请勿非法操作!", true ); CommonManager.Web.RegJs(this, "alert('请勿非法操作!');", false); return; } DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "Web_VGameRoomInfo") .AddInputParameter("@Wheres", DbType.String, SqlW) .AddInputParameter("@KeyName", DbType.String, "id") .AddInputParameter("@OrderBy", DbType.String, "IDSort desc,id desc") .ToDataSet(); if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; RoomListInfos.DataSource = ds.Tables[1]; RoomListInfos.DataBind(); RoomListInfos.Visible = true; NoRoomListInfos.Visible = false; } else { RoomListInfos.Visible = false; NoRoomListInfos.Visible = true; } }