Manger/EditProduct.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;
using System.Data.SqlClient;
using System.Text.RegularExpressions;

public partial class Manger_EditProduct : System.Web.UI.Page
{
    MangerClass mcObj = new MangerClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            mcObj.ddlClassBind(ddlCategory);
            mcObj.ddlUrl(ddlUrl);
            GetGoodsInfo();
        }
    }
    /// <summary>
    /// 获取指定商品的信息,并将其显示在界面上
    /// </summary>
    public void GetGoodsInfo()
    {
        DataSet ds = mcObj.GetGoodsInfoByIDDs(Convert.ToInt32(Request["GoodsID"].Trim()),"GoodsInfo");
        txtName.Text=ds.Tables["GoodsInfo"].Rows[0][2].ToString();
        ddlCategory.SelectedValue = ds.Tables["GoodsInfo"].Rows[0][1].ToString();
        txtBrand.Text = ds.Tables["GoodsInfo"].Rows[0][4].ToString();
        txtUnit.Text = ds.Tables["GoodsInfo"].Rows[0][5].ToString();
        txtWeight.Text =mcObj.VarStr( ds.Tables["GoodsInfo"].Rows[0][6].ToString(),2);
        txtMarketPrice.Text = mcObj.VarStr(ds.Tables["GoodsInfo"].Rows[0][8].ToString(),2);
        txtMemberPrice.Text = mcObj.VarStr(ds.Tables["GoodsInfo"].Rows[0][9].ToString(),2);
        ddlUrl.SelectedValue = ds.Tables["GoodsInfo"].Rows[0][7].ToString();
        ImageMapPhoto.ImageUrl = ddlUrl.SelectedItem.Value;
        cbxCommend.Checked = Convert.ToBoolean(ds.Tables["GoodsInfo"].Rows[0][10].ToString());
        cbxHot.Checked = Convert.ToBoolean(ds.Tables["GoodsInfo"].Rows[0][11].ToString());
        cbxDiscount.Checked = Convert.ToBoolean(ds.Tables["GoodsInfo"].Rows[0][13].ToString());
        txtShortDesc.Text = ds.Tables["GoodsInfo"].Rows[0][3].ToString();
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (txtName.Text == "" || txtBrand.Text == "" || txtUnit.Text == "" || txtWeight.Text == "" || txtMemberPrice.Text == "" || txtMarketPrice.Text == "")
        {
            Response.Write("<script>alert('请输入必要的信息!')</script>");

        }
        else if (IsValidInt(txtWeight.Text.Trim()) == false || IsValidInt(txtMarketPrice.Text.Trim()) == false || IsValidInt(txtMemberPrice.Text.Trim()) == false)
        {
            Response.Write("<script>alert('请正确输入(格式:1.00)!')</script>");
        }
        else
        {
            bool Isrefinement;
            bool IsHot;
后面还有 41 行代码,解锁后查看完整代码

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

AI 解读

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

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