Web/productinfo.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 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;

namespace ClothesShop.Web
{
    public partial class productinfo : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.Bind();
                pro.updatepointnum(int.Parse(this.Request.QueryString["pid"].ToString()));
            }
        }

        ClothesShop.BLL.product pro = new ClothesShop.BLL.product();
        ClothesShop.BLL.type_1 t_1 = new ClothesShop.BLL.type_1();
        ClothesShop.BLL.type_2 t_2 = new ClothesShop.BLL.type_2();

        private void Bind()
        {
            int pid = int.Parse(this.Request.QueryString["pid"].ToString());
            DataRow row = pro.getoneproduct(pid);
            this.productnameliteral.Text = row["productname"].ToString();
            this.IMG1.Src = "pic/" + row["imagepath"].ToString();
            this.type_1nameliteral.Text = t_1.gettypename(int.Parse(row["typeid_1"].ToString()));
            this.type_2nameliteral.Text = t_2.gettypename(int.Parse(row["typeid_2"].ToString()));
            this.pointcountliteral.Text = row["pointcount"].ToString();
            this.countliteral.Text = (int.Parse(row["count"].ToString()) > int.Parse(row["sellcount"].ToString())) ? row["count"].ToString() : "缺货";
            this.sellcountliteral.Text = row["sellcount"].ToString();
            this.priceliteral.Text = row["price"].ToString();
            this.userpriceliteral.Text = row["userprice"].ToString();
            this.specialsliteral.Text = row["specialsprice"].ToString();
            this.descriptionliteral.Text = row["description"].ToString();
        }
        /// <summary>
        /// 添加到购物车
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void addcart_Click(object sender, ImageClickEventArgs e)
        {
            ClothesShop.BLL.userinfo user = new ClothesShop.BLL.userinfo();
            if (user.IsLogin() == true)
            {
                if (this.countliteral.Text.Trim() != "缺货")
                {
                    ClothesShop.BLL.cart ocart = new ClothesShop.BLL.cart();
                    if (ocart.isexitproduct(int.Parse(this.Request.QueryString["pid"].ToString()),user.getUserID()) == false)
                    {
                        if (ocart.createcart(int.Parse(this.Request.QueryString["pid"].ToString()), user.getUserID(), 1, false) == 1)
后面还有 33 行代码,购买后查看完整代码

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

AI 解读 AI

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

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