MySale.aspx.cs

(完整代码) 2KB

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 MySale : 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 loadMySale(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 inner join UserInfo_Tbl c on a.userID=c.id where a.del=0 and c.del=0 and b.userID='" + hid + "' and b.del=0 and isOver=1 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 inner join UserInfo_Tbl c on a.userID=c.id where a.del=0 and c.del=0 and isOver=1 and b.del=0 and b.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><td>" + ds.Tables[0].Rows[i]["tel"] + "</td><td>" + ds.Tables[0].Rows[i]["address"] + "</td><td><input type='button' value='发货' class='btn' id='" + ds.Tables[0].Rows[i]["id"] + "'/></td></tr>";
            }
            return html;
        }
        [WebMethod]
        public static int FHMySale(string id)
        {
            DBHelper db = new DBHelper();
            WebHelper wb = new WebHelper();
            string sql = "update ShoppingCart_Tbl set isOver=2 where id='" + id + "'";
            int renum = db.ExecuteSql(sql);
            if (renum == 1)
            {
                return 1;
            }
            else
            {
                return 0;
            }

        }
    }
}

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

AI 解读 AI

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

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