Server/Server.cs
(开头部分) 35KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Web;
using System.Web.Security;
using System.ComponentModel;
using System.IO;//文件用
using System.Text.RegularExpressions;
namespace UbuyServer
{
public class Server : Web.UI.BasePage
{
//添加到Session(没有登录)
public static string BuyPro(int number, string ProductId, int id,int type)
{
if (HttpContext.Current.Session["Cart"] == null)
{
BuildCart(number, ProductId, id, type);
}
else
{
DataTable cart = HttpContext.Current.Session["Cart"] as DataTable;
if (Existproduct(cart, number, ProductId, id))
{
if (type == 1)
{
BuildPhoneSession(cart, number, ProductId, id);
}
else
{
BuildSession(cart, number, ProductId, id);
}
}
}
return GetCartPro();
}
protected static string GetCartPro()
{
DataTable cart = (DataTable)HttpContext.Current.Session["Cart"];
double Total = 0;
if (cart != null)
{
foreach (DataRow dr in cart.Rows)
{
Total += Convert.ToDouble(dr["ProductPrice"].ToString()) * Convert.ToDouble(dr["Number"].ToString());
}
return "购物车已有宝贝<font style='color:red;font-weight:bold'> " + cart.Rows.Count + "</font>种,总价:¥<font style='color:red;font-weight:bold'>" + Total + "</font>";
}
return "购物车目前为空,总价:0元";
}
//添加到数据库中
public static void BuyProDataBase(int number, string ProductId, int id,int type)
{
BLL.ShoppingCart bll = new BLL.ShoppingCart();
Model.ShoppingCart model = new Model.ShoppingCart();
if (bll.ExistsPro(int.Parse(ProductId), int.Parse(HttpContext.Current.Session["MemberLogin_Id"].ToString())))
{
后面还有 889 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。