FLOWER/UserCreateOrder.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FLOWER
{
    public partial class UserCreateOrder : System.Web.UI.Page
    {
        Common.SQLHelper hp = new Common.SQLHelper();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack) 
            {
                if (Session["username"] == null)
                {
                    Response.Redirect("Login.aspx");
                }
                DataTable udt = hp.Query("select * from [User] where userid = "+Session["UserId"].ToString()).Tables[0];
                TextBox1.Text = udt.Rows[0]["UserName"].ToString();
                TextBox2.Text = udt.Rows[0]["UserPhone"].ToString();
                TextBox3.Text = udt.Rows[0]["UserAddress"].ToString();
                string cid = Request["id"].ToString().Replace("ck","").Replace("|",",");
                DataTable dt = new Common.SQLHelper().Query("select *,(select CurtainPhone from Curtains where Curtains.CurtainId = carts.productid) as CurtainPhone,(select CurtainName from Curtains where Curtains.CurtainId = carts.productid) as CurtainName,(select price from ProductKC where ProductKC.productid = carts.productid and ProductKC.guige = carts.guige) as CurtainPrice from carts where infoid in (" + cid + ") and userid=" + Session["userid"].ToString()).Tables[0];
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            string cid = Request["id"].ToString().Replace("ck", "").Replace("|", ",");
            DataTable dt = new Common.SQLHelper().Query("select *,(select ProductNum from ProductKC where ProductKC.productid = carts.productid and ProductKC.guige = carts.guige) as ProductNum,(select CurtainName from Curtains where Curtains.CurtainId = carts.productid) as CurtainName,(select price from ProductKC where ProductKC.productid = carts.productid and ProductKC.guige = carts.guige) as CurtainPrice from carts where infoid in (" + cid + ") and userid=" + Session["userid"].ToString()).Tables[0];
            List<Common.CommandInfo> list = new List<Common.CommandInfo>();
            string orderid = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            decimal allprice = 0.00M;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (int.Parse(dt.Rows[i]["ProductNum"].ToString()) < int.Parse(dt.Rows[i]["bcnum"].ToString()))
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('【" + dt.Rows[i]["CurtainName"].ToString() + "】(" + dt.Rows[i]["guige"].ToString() + ")库存不足!', { icon: 2, kin: 'layer-ext-moon', closeBtn: 0, success: function () { $(':focus').blur(); } });", true);
                    return;
                }
                Common.CommandInfo info = new Common.CommandInfo();
                info.CommandText = "update ProductKC set productnum = productnum - " + int.Parse(dt.Rows[i]["bcnum"].ToString()) + " where productid = " + int.Parse(dt.Rows[i]["productid"].ToString()) + " and guige = '" + dt.Rows[i]["guige"].ToString() + "'";
                info.EffentNextType = Common.EffentNextType.ExcuteEffectRows;
                info.Parameters = null;
                list.Add(info);
                allprice += int.Parse(dt.Rows[i]["bcnum"].ToString()) * decimal.Parse(dt.Rows[i]["CurtainPrice"].ToString());
                Common.CommandInfo info1 = new Common.CommandInfo();
                info1.CommandText = "insert into bkorderinfo(orderid,productid,price,bknum,allprice,userid,guige) values('" + orderid + "'," + dt.Rows[i]["productid"].ToString() + ",'" + dt.Rows[i]["CurtainPrice"].ToString() + "'," + dt.Rows[i]["bcnum"].ToString() + ",'" + int.Parse(dt.Rows[i]["bcnum"].ToString()) * decimal.Parse(dt.Rows[i]["CurtainPrice"].ToString()) + "'," + Session["userid"].ToString() + ",'" + dt.Rows[i]["guige"].ToString() + "')";
                info1.EffentNextType = Common.EffentNextType.ExcuteEffectRows;
                info1.Parameters = null;
                list.Add(info1);
            }

            Common.CommandInfo info2 = new Common.CommandInfo();
后面还有 22 行代码,购买后查看完整代码

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

AI 解读 AI

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

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