Web/Admin/productAdmin/product_update.aspx.cs

(开头部分) 3KB

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

public partial class admin_product_product_update : basePage
{
    upImage ui = new upImage();
    PublicClass pc = new PublicClass();
    Bll.ProductBll B_pro = new Bll.ProductBll();
    Model.tab_products M_pro = new Model.tab_products();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //this.CheckUser();
            pc.GetProductClass(this.DropDownList1);
            string proID = Request.QueryString["proID"];
            ViewState["proID"] = int.Parse(proID);
            showProduct(proID);
            
        }
    }
    void showProduct(string proID)
    {
        DataTable dt = B_pro.SelectPro("select * from tab_products,tab_productClass where tab_products.productClassID=tab_productClass.productClassID and productID=" + proID);
        this.TextBox1.Text = dt.Rows[0]["productName"].ToString();
        this.TextBox2.Text = dt.Rows[0]["productUnitPrice"].ToString();
        this.TextBox3.Text = dt.Rows[0]["productCount"].ToString();

        this.TextBox4.Text = dt.Rows[0]["productContent"].ToString();
        this.Image1.ImageUrl = "~//Images//SmallImages" + "//" + dt.Rows[0]["productImg"].ToString();

        for (int i = 0; i < this.DropDownList1.Items.Count; i++)
        {
            if (this.DropDownList1.Items[i].Value == dt.Rows[0]["productClassID"].ToString())
            {
                this.DropDownList1.SelectedIndex = i;
            }
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        StringBuilder str = new StringBuilder();
        str.Append("update tab_products set ");
        str.AppendFormat("productName='{0}',", this.TextBox1.Text);
        str.AppendFormat("productClassID={0},", this.DropDownList1.SelectedValue);
        str.AppendFormat("productUnitPrice={0},", this.TextBox2.Text);
        str.AppendFormat("productCount={0},", this.TextBox3.Text);
        str.AppendFormat("productContent='{0}',", this.TextBox4.Text);
        if (this.File1.Value != "" || this.File1.Value != string.Empty)
        {
后面还有 18 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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