Usercontrol/CommentPage.ascx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Usercontrol_CommentPage : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
string id = Request["id"];
if (!IsPostBack)
{
NewMethod(id);
}
}
private void NewMethod(string id)
{
DAL.DataAccess.DatalistBang(string.Format("SELECT WenJu.Id, WenJu.Name, WenJu.Price, WenJu.Introduction, Categories.Name AS Expr2, WenJu.Review, WenJu.ISBN FROM WenJu INNER JOIN Categories ON WenJu.CategoriesId = Categories.Id Where WenJu.Id='{0}'", id), DataList1);
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
string GoodsId = ((Label)e.Item.FindControl("Label9")).Text;//获取当前的DataLIst中所需属性的值
string views = ((Label)e.Item.FindControl("Label11")).Text;
ShoppingCar cookieCart = new ShoppingCar();
ShoppingItem shopitem = new ShoppingItem();
DataBaseShoppingCar datacar = new DataBaseShoppingCar();
shopitem.Id = Int64.Parse(GoodsId);
shopitem.Name = ((Label)e.Item.FindControl("Label1")).Text;
shopitem.Price = double.Parse(((Label)e.Item.FindControl("Label4")).Text);
shopitem.Quantity = 1;
if (e.CommandName == "Buying")
{
if (Session["Name"] == null)
{
cookieCart.add(shopitem);
e.Item.FindControl("Label10").Visible = true;
}
else
{
datacar.add(shopitem.Id.ToString(), Session["UserId"].ToString(), shopitem.Quantity.ToString());
Response.Redirect("~/ShoppingCar/ShoppingCar.aspx");
}
}
if (e.CommandName == "pinglun")
{
if (Session["Name"] == null)
{
后面还有 63 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。