Myorderlist.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.Data.SqlClient;

public partial class Myorderlist : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["sex"] == null || Session["sex"].ToString() == "")
        {
            Response.Write("<script language='javascript'>alert('请先登陆!');</script>");
            Response.Write("<script language='javascript'>window.history.go(-1);</script>");
        }
        else
        {
            if (!IsPostBack)
            {
                BindShopBasket();
            }
        }
    }
    //获取订单表格
    private void bind_ordertables()
    {
        string strConn = ConfigurationManager.ConnectionStrings["sq_chaletshopConnectionString"].ToString();
        SqlConnection conn = new SqlConnection(strConn);
        string strSql = "select * from orderinfo where email='"+Session["email"].ToString()+"' order by orderid desc";
        SqlDataAdapter da = new SqlDataAdapter(strSql, conn);
        DataSet ds = new DataSet();
        da.Fill(ds);
        this.gvProducts.DataSource = ds;
        this.gvProducts.DataKeyNames = new string[] { "id" };
        this.gvProducts.DataBind();
        da.Dispose();
        conn.Dispose();
    }
    //计算商品总价格,运费,总花费
    protected void Total()
    {
        double allmoney1=0;

        string strConn = ConfigurationManager.ConnectionStrings["sq_chaletshopConnectionString"].ToString();
        SqlConnection conn = new SqlConnection(strConn);
        string strSql = "select * from orderinfo where email='" + Session["email"].ToString() + "' order by orderid desc";
        SqlDataAdapter da = new SqlDataAdapter(strSql, conn);
        DataSet ds = new DataSet();
        da.Fill(ds,"orderTotal");
        //循环遍历购物篮
        for (int i = 0; i < ds.Tables["orderTotal"].Rows.Count; i++)
        {
            allmoney1 += Convert.ToDouble(ds.Tables["orderTotal"].Rows[i]["SubToTal"]);
        }
后面还有 43 行代码,购买后查看完整代码

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

AI 解读 AI

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

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