goodsdetail.aspx.cs

来自「这是我做的第一个网络购书中心asp.net网站!」· CS 代码 · 共 53 行

CS
53
字号
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;

public partial class User_GoodsDetail : System.Web.UI.Page
{
    MangerClass mc = new MangerClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            GetGoodsInfo();
        }
    }
    public void GetGoodsInfo()
    {
        string GoodsId=Request["GoodsID"].Trim();
        DataSet ds = mc.GetGoodsInfoByID(GoodsId, "tb_GoodsInfo");
        txtName.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["GoodsName"].ToString();
        //txtFName
        txtBrand.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["GoodsBrand"].ToString();
        txtUnit.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["GoodsUnit"].ToString();       
        txtMarketPrice.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["MarketPrice"].ToString();
        txtMemberPrice.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["MemberPrice"].ToString();
        ImagePhoto.ImageUrl = ds.Tables["tb_GoodsInfo"].Rows[0]["GoodsUrl"].ToString();
        txtShortDesc.Text = ds.Tables["tb_GoodsInfo"].Rows[0]["GoodsIntroduce"].ToString();
        if (ds.Tables["tb_GoodsInfo"].Rows[0]["Isrefinement"].ToString() == "1")
        {
            cbxCommend.Checked = true;
        }
        if (ds.Tables["tb_GoodsInfo"].Rows[0]["IsDiscount"].ToString() == "1")
        {
            cbxDiscount.Checked = true;
        }
        if (ds.Tables["tb_GoodsInfo"].Rows[0]["IsHot"].ToString() == "1")
        {
            cbxHot.Checked = true;
        }
    }
    protected void btnExit_Click(object sender, EventArgs e)
    {
        string url=Session["address"].ToString();
        Response.Redirect(url);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?