Web/ProductView.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace cosmos.Web
{
public partial class ProductView : System.Web.UI.Page
{
protected int Id; //全局变量Id
protected cosmos.Model.ProductInfo model = new cosmos.Model.ProductInfo();
protected void Page_Load(object sender, EventArgs e)
{
if (!int.TryParse(Request.Params["id"] as string, out this.Id))
{
Response.Write("<script>alert('您要查看的信息参数不正确或不存在!'),location.href='ProductList.aspx';</script>");
return;
}
cosmos.BLL.ProductInfo bll = new cosmos.BLL.ProductInfo();
model = bll.GetModel(this.Id);//获得Id
//浏览数+1
bll.UpdateField(this.Id, "Click=Click+1");
}
//取得分类名称
protected string GetClassTitle(int _classId)
{
cosmos.BLL.Channel cbll = new cosmos.BLL.Channel();
if (!cbll.Exists(_classId))
{
return "No Category";
}
cosmos.Model.Channel cmodel = cbll.GetModel(_classId);
return cmodel.Title;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。