mydingdan.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;

public partial class mydingdan : System.Web.UI.Page
{
    String SqlStr;
    DB db = new DB();
    DataSet Ds = new DataSet();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Username"] == null)
            {
                Response.Redirect("Error.aspx");
            }
            this.order_no_txtbox.Focus();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (this.order_no_txtbox.Text != "")
        {
            SqlStr = "select * from 详细订单视图 where 会员名='" + Session["Username"]
                + "' and 订单编号='" + this.order_no_txtbox.Text + "'";
            Ds = db.GetDataTableBySql(SqlStr);
            if (Ds.Tables[0].Rows.Count != 0)
            {
                this.GridView1.DataSource = Ds.Tables[0].DefaultView;
                this.GridView1.DataBind();
                this.GridView1.Visible = true;
                int i, count;
                Double price, sum = 0;
                for (i = 0; i < Ds.Tables[0].Rows.Count; i++)
                {
                    price = Double.Parse(Ds.Tables[0].Rows[i]["价格"].ToString());
                    count = int.Parse(Ds.Tables[0].Rows[i]["数量"].ToString());
                    sum += price * count;
                }
                this.totaltxtbox.Text = sum.ToString();
            }
            else
            {
                this.GridView1.Visible = false;
                Response.Write("<script>alert('此订单编号不存在!')</script>");
                this.order_no_txtbox.Focus();
            }
        }
        else
        {
            this.GridView1.Visible = false;
            Response.Write("<script>alert('请输入要查询的订单编号!')</script>");
后面还有 5 行代码,购买后查看完整代码

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

AI 解读 AI

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

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