首次推送
This commit is contained in:
96
Mtxfw.shop/article.aspx.cs
Normal file
96
Mtxfw.shop/article.aspx.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace Mtxfw.shop
|
||||
{
|
||||
public partial class Article : System.Web.UI.Page
|
||||
{
|
||||
public String MenuName = String.Empty, MenuName2 = "";
|
||||
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
||||
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config();
|
||||
public String value = String.Empty, strdisplay = String.Empty, LocationName = "文章详情";
|
||||
public int ParentID = 0;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
String GetID = Request.QueryString["ID"];
|
||||
if (!String.IsNullOrEmpty(GetID) && Mtxfw.Utility.Tools.HasInt(GetID))
|
||||
{
|
||||
Int32 ID = int.Parse(Mtxfw.Utility.Tools.SafeSQL(Request.QueryString["ID"]));
|
||||
Mtxfw.Model.Article model = daoArt.GetModel(ID);
|
||||
if (model != null)
|
||||
{
|
||||
Page.Title = model.Title + " - " + config.webName;
|
||||
|
||||
Lit_Time.Text = model.AddTime.ToString();
|
||||
Lit_Content.Text = model.Content;
|
||||
ParentID = model.ParentID;
|
||||
MenuName = model.Title;
|
||||
if (ParentID < 8)
|
||||
{
|
||||
MenuName2 = " > " + model.Title;
|
||||
strdisplay = " style=\"display:none\"";
|
||||
LocationName = "<a href=\"/shop_guests.aspx\">服务中心</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
MenuName2 = "";
|
||||
}
|
||||
if (ParentID == 8)
|
||||
{
|
||||
if (Session["MemberId"] != null)
|
||||
{
|
||||
if (model.receiverid == int.Parse(Session["MemberId"].ToString()))
|
||||
{
|
||||
daoArt.UpdateuSel("Seef", 1, ID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string RUrl = Request.Url.ToString();
|
||||
Response.Cookies.Add(new HttpCookie("{RUrl}", RUrl));
|
||||
Response.Cookies["{RUrl}"].Expires = DateTime.Now.AddDays(1);
|
||||
Mtxfw.Utility.Tools.Message("您未登录!", "/");
|
||||
}
|
||||
}
|
||||
Page.Title = MenuName + " - " + config.webName;
|
||||
Page.MetaDescription = MenuName + " - " + config.webName;
|
||||
Page.MetaKeywords = MenuName + "," + config.webName;
|
||||
Mtxfw.Model.Article MinModel = daoArt.GetMinModel(ID, ParentID);
|
||||
Mtxfw.Model.Article MaxModel = daoArt.GetMaxModel(ID, ParentID);
|
||||
if (MinModel != null)
|
||||
{
|
||||
Hy_Min.NavigateUrl = "/article-" + MinModel.id.ToString() + ".html";
|
||||
Hy_Min.Text = MinModel.Title;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hy_Min.Enabled = false;
|
||||
Hy_Min.Text = "没有了";
|
||||
}
|
||||
|
||||
if (MaxModel != null)
|
||||
{
|
||||
Hy_Max.NavigateUrl = "/article-" + MaxModel.id.ToString() + ".html";
|
||||
Hy_Max.Text = MaxModel.Title;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hy_Max.Enabled = false;
|
||||
Hy_Max.Text = "没有了";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.StatusCode = 404;
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user