MyBuy.aspx.cs

(完整代码) 1KB

using MyWeb.DBUtility;
using MyWeb.WebUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyWeb
{
    public partial class MyBuy : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DBHelper db = new DBHelper();
                Hidden1.Value = Session["id"].ToString();
            }
        }
        [WebMethod]
        public static string loadMyBuy(string pi, string ps, string hid)
        {
            DBHelper db = new DBHelper();
            //分页sql查询列表数据
            string sql = "select top " + ((Convert.ToInt32(pi) - 1) * Convert.ToInt32(ps) + Convert.ToInt32(ps)) + " * from ShoppingCart_Tbl a inner join Goods_Tbl b on a.foodsID=b.id where a.del=0 and a.userID='" + hid + "' and b.del=0 and isOver=2 and a.id not in (select top " + ((Convert.ToInt32(pi) - 1) * Convert.ToInt32(ps)) + " a.id from ShoppingCart_Tbl a inner join Goods_Tbl b on a.foodsID=b.id where a.del=0 and isOver=2 and b.del=0 and a.userID='" + hid + "' order by a.addDate desc) order by a.addDate desc";
            DataSet ds = db.Query(sql);
            string html = "";
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                //得到列表数据
                html += "<tr><td>" + ds.Tables[0].Rows[i]["FoodsName"] + "</td><td>" + ds.Tables[0].Rows[i]["foodsNum"] + "</td><td>" + ds.Tables[0].Rows[i]["Price"] + "</td><td>" + (Convert.ToDouble(ds.Tables[0].Rows[i]["Price"]) * Convert.ToDouble(ds.Tables[0].Rows[i]["foodsNum"])) + "</td></tr>";
            }
            return html;
        }
    }
}

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

AI 解读 AI

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

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