WebSite/ViewGoods.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using NBear.Data;
using Entities;

public partial class ViewGoods : SdaiBuyPage 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //加载物品信息和旁边购买该产品的人
        int intGoodID = GetIntParam("id", -1);
        dsMessage.Filter(Message._.GoodsID.ID == intGoodID);
        PageMessage.DataBind();
        //dsSellRecord.Filter(SellRecord._.Products.ID == intGoodID);
        //pageSellRecord.DataBind();
    }
    protected void btnBuy_Click(object sender, EventArgs e)
    {
        if (Session["UserID"] == null)
        {
            Response.Redirect("Userlogin.aspx?fromurl=" + Request.Url.ToString());
        }
        else
        {
            string GoodsID = GetStringParam("Id","-1");
            Response.Redirect("buy.aspx?id=" + GoodsID);
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        if (Session["UserID"] == null)
        {
            Response.Redirect("Userlogin.aspx?fromurl=" + Request.Url.ToString());
        }
        else
        {
            string GoodsID = GetStringParam("Id", "-1");
            Response.Redirect("buy.aspx?id=" + GoodsID);
        }
    }
    protected void btnSubmitComment_Click(object sender, EventArgs e)
    {
        int UserID = Convert.ToInt32 ( Session["UserID"].ToString());
        int GoodsID = GetIntParam ("Id",-1);
        Message aMessage = new Message();
        Entities.User aUser = Gateways.SdaiBuy.Find<Entities.User>(UserID);
        Goods aGoods = Gateways.SdaiBuy.Find<Goods>(GoodsID);
        aMessage.Content = tbComment.Text.Trim();
        aMessage.LastUpdate = DateTime.Now;
        aMessage.UserID = aUser;
        aMessage.GoodsID = aGoods;
后面还有 4 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。