148 lines
7.5 KiB
C#
148 lines
7.5 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Drawing;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.SessionState;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
using System.Web.UI.HtmlControls;
|
|||
|
|
|
|||
|
|
namespace Mtxfw.shop.bbs
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// myShoppingCart <20><>ժҪ˵<D2AA><CBB5><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public partial class lists : System.Web.UI.Page
|
|||
|
|
{
|
|||
|
|
Mtxfw.DAL.Ads daoAds = new Mtxfw.DAL.Ads();
|
|||
|
|
protected string ShowConent = "";
|
|||
|
|
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|||
|
|
public Mtxfw.DAL.forum daoforum = new Mtxfw.DAL.forum();
|
|||
|
|
public Mtxfw.DAL.bbs daobbs = new Mtxfw.DAL.bbs();
|
|||
|
|
Mtxfw.Utility.Config config = new Mtxfw.Utility.Config();
|
|||
|
|
protected int IFStores = 0, ClassID=0;
|
|||
|
|
protected string AdsName01, AdsName02;
|
|||
|
|
protected string indexTP01, indexTP02;
|
|||
|
|
protected string indexTPLink01, indexTPLink02;
|
|||
|
|
protected string strposition = "", iftj = "0", strUrl = "/forum.html?page={0}";
|
|||
|
|
protected void Page_Load(object sender, System.EventArgs e)
|
|||
|
|
{
|
|||
|
|
// <20>ڴ˴<DAB4><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Գ<EFBFBD>ʼ<EFBFBD><CABC>ҳ<EFBFBD><D2B3>
|
|||
|
|
if (Session["MemberId"] != null && Session["MemberIFStores"] != null)
|
|||
|
|
{
|
|||
|
|
IFStores = int.Parse(Session["MemberIFStores"].ToString());
|
|||
|
|
}
|
|||
|
|
System.Data.DataSet Ds_Ads = daoAds.GetCacheList("top 1", "utype=N'<27><>̳<EFBFBD><CCB3><EFBFBD><EFBFBD>' Order By AdsSort desc", "bbs_Ads2");
|
|||
|
|
System.Data.DataTable Dt_Ads = Ds_Ads != null && Ds_Ads.Tables[0] != null ? Ds_Ads.Tables[0] : null;
|
|||
|
|
foreach (System.Data.DataRow Dr in Dt_Ads.Rows)
|
|||
|
|
{
|
|||
|
|
indexTP01 = Dr["AdsPic"].ToString();
|
|||
|
|
indexTPLink01 = Dr["AdsUrl"].ToString();
|
|||
|
|
AdsName01 = Dr["AdsName"].ToString();
|
|||
|
|
}
|
|||
|
|
if (!Page.IsPostBack)
|
|||
|
|
{
|
|||
|
|
MyPager.UrlRewritePattern = strUrl;
|
|||
|
|
myDataBind();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private void myDataBind()
|
|||
|
|
{
|
|||
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
|||
|
|
String ClsID = Mtxfw.Utility.Tools.SafeSQL(Request.QueryString["classid"]);
|
|||
|
|
String stype = Mtxfw.Utility.Tools.SafeSQL(Request.QueryString["stype"]);
|
|||
|
|
String key = Mtxfw.Utility.Tools.SafeSQL(HttpUtility.UrlDecode(Request.QueryString["keyword"]));
|
|||
|
|
String iPage = Mtxfw.Utility.Tools.SafeSQL(Request.QueryString["Page"]);
|
|||
|
|
Page.Title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webName;
|
|||
|
|
Page.MetaDescription = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webKeywords;
|
|||
|
|
strposition = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
|
if (!String.IsNullOrEmpty(stype) && stype != "-1")
|
|||
|
|
{
|
|||
|
|
strUrl = "/forum-type-" + stype + ".html?page={0}";
|
|||
|
|
MyPager.UrlRewritePattern = strUrl;
|
|||
|
|
if (stype == "tj")
|
|||
|
|
{
|
|||
|
|
iftj = "1";
|
|||
|
|
sb.Append(" and B_IFTJ=1");
|
|||
|
|
Page.Title = "<22>ص<EFBFBD><D8B5>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>-" + config.webName;
|
|||
|
|
Page.MetaDescription = "<22>ص<EFBFBD><D8B5>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>-" + config.webName + "-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = "<22>ص<EFBFBD><D8B5>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>," + config.webKeywords;
|
|||
|
|
strposition = "<22>ص<EFBFBD><D8B5>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
|
}
|
|||
|
|
if (stype == "hot")
|
|||
|
|
{
|
|||
|
|
sb.Append(" and B_IFHot=1");
|
|||
|
|
Page.Title = "<22><><EFBFBD><EFBFBD>ר<EFBFBD><D7A8>-" + config.webName;
|
|||
|
|
Page.MetaDescription = "<22><><EFBFBD><EFBFBD>ר<EFBFBD><D7A8>-" + config.webName + "-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = "<22><><EFBFBD><EFBFBD>ר<EFBFBD><D7A8>," + config.webKeywords;
|
|||
|
|
strposition = "<22><><EFBFBD><EFBFBD>ר<EFBFBD><D7A8>";
|
|||
|
|
}
|
|||
|
|
if (stype == "0" || stype == "1" || stype == "2" || stype == "3" || stype == "4" || stype == "5" || stype == "6" || stype == "7")
|
|||
|
|
{
|
|||
|
|
sb.Append(" and B_TType=" + stype);
|
|||
|
|
Page.Title = "<22><><EFBFBD><EFBFBD>" + Mtxfw.Utility.Common.GetB_TType(stype) + "<22><><EFBFBD><EFBFBD>-" + config.webName;
|
|||
|
|
Page.MetaDescription = "<22><><EFBFBD><EFBFBD>" + Mtxfw.Utility.Common.GetB_TType(stype) + "<22><><EFBFBD><EFBFBD>-" + config.webName + "-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = "<22><><EFBFBD><EFBFBD>" + Mtxfw.Utility.Common.GetB_TType(stype) + "<22><><EFBFBD><EFBFBD>," + config.webKeywords;
|
|||
|
|
strposition = "<22><><EFBFBD><EFBFBD>" + Mtxfw.Utility.Common.GetB_TType(stype) + "<22><><EFBFBD><EFBFBD>";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(ClsID) && ClsID != "-1")
|
|||
|
|
{
|
|||
|
|
ClsID = Mtxfw.Utility.Tools.SafeSQL(ClsID);
|
|||
|
|
strUrl = "forum-" + ClsID + ".html?page={0}";
|
|||
|
|
MyPager.UrlRewritePattern = strUrl;
|
|||
|
|
ClassID = Convert.ToInt32(ClsID);
|
|||
|
|
System.Data.DataSet Ds = daoforum.GetList1("B_pid,B_Id,B_ForumName,B_Layer,(select b.B_ForumName From forum b where b.B_Id=a.B_pid) as PForumName", "B_ID=" + ClsID);
|
|||
|
|
if (Ds.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
int B_pid = Convert.ToInt32(Ds.Tables[0].Rows[0]["B_pid"].ToString());
|
|||
|
|
int B_Layer = Convert.ToInt32(Ds.Tables[0].Rows[0]["B_Layer"].ToString());
|
|||
|
|
string B_ForumName = Ds.Tables[0].Rows[0]["B_ForumName"].ToString();
|
|||
|
|
string PForumName = Ds.Tables[0].Rows[0]["PForumName"].ToString();
|
|||
|
|
if (B_Layer == 2)
|
|||
|
|
{
|
|||
|
|
sb.Append(" and B_ForumID=" + ClsID);
|
|||
|
|
Page.Title = B_ForumName + "-" + PForumName + "-" + config.webName;
|
|||
|
|
Page.MetaDescription = B_ForumName + "-" + PForumName + "-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = B_ForumName + "," + PForumName + "-" + config.webKeywords;
|
|||
|
|
strposition = "<a href=\"/bbs/forum-" + B_pid + ".html\">" + PForumName + "</a> > " + B_ForumName;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sb.Append(" and (B_ForumID=" + ClsID + " Or B_ForumIds Like '%," + ClsID + ",%')");
|
|||
|
|
Page.Title = B_ForumName + "-" + config.webName;
|
|||
|
|
Page.MetaDescription = B_ForumName + "-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = B_ForumName + "-" + config.webKeywords;
|
|||
|
|
strposition = B_ForumName;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Ds.Clear();
|
|||
|
|
}
|
|||
|
|
if (!String.IsNullOrEmpty(key))
|
|||
|
|
{
|
|||
|
|
key = Mtxfw.Utility.Tools.SafeSQL(key);
|
|||
|
|
strUrl = "/forum.html?keyword=" + key + "&page={0}";
|
|||
|
|
sb.Append(" and (B_Title like '%" + key + "%')");
|
|||
|
|
Page.Title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webName;
|
|||
|
|
Page.MetaDescription = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webDescription;
|
|||
|
|
Page.MetaKeywords = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-" + config.webKeywords;
|
|||
|
|
strposition = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
|
}
|
|||
|
|
string strOrder = "B_IFGG Desc,B_SetTop Desc,B_LastSubmitDate Desc,B_UpDate Desc";
|
|||
|
|
MyPager.PageSize = 50;
|
|||
|
|
if (!String.IsNullOrEmpty(iPage) && iPage != "-1")
|
|||
|
|
{
|
|||
|
|
MyPager.CurrentPageIndex = int.Parse(iPage);
|
|||
|
|
}
|
|||
|
|
MyPager.RecordCount = daobbs.GetCount("B_IFDelete=0 And B_seef=1 And B_Layer=0" + sb.ToString());
|
|||
|
|
Mtxfw.Utility.Tools.ToBind(Repeater1, daobbs.GetPager(MyPager, "(Select username From user_info b where b.id=a.B_MemberId) as MemberName,(Select username From user_info b where b.id=a.B_LastMemberId) as LastMemberName,", "B_IFDelete=0 And B_seef=1 And B_Layer=0" + sb.ToString() + " Order by " + strOrder));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|