资源简介
我自己做的 按照老师的要求 可以购物 界面做的还可以 下载下来之后直接解压 内涵数据库 直接就可以用了

代码片段和文件信息
using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.xml.Linq;
using System.Data.SqlClient;
[WebService(Namespace = “http://tempuri.org/“)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.script.Services.scriptService]
public class Service : System.Web.Services.WebService
{
public Service()
{
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod]
public int pay(string userID int Money)
{
if (giveMoney(userID Money) == 0)
{
return 0;
}
else
{
return getMoney((Money));
}
}
public int giveMoney(string userID int Money)
{
int money = 0;
SqlConnection con = new SqlConnection(“server=WTJ-PC\\SQLEXPRESS;database=shop;uid=sa;password=123“);
con.Open();
string sql = “select * from users where userID=‘“ + userID + “‘“;
SqlCommand sqlCmd = new SqlCommand(sql con);
SqlDataReader dr = sqlCmd.ExecuteReader();
if (dr.Read())
{
money=int.Parse(dr[“money“].ToString());
}
con.Close();
if (money <= Money || money <= 0)
{
return 0;
}
else
{
money -= Money;
}
con.Open();
sql = “update users set money=‘“ + money + “‘ where userID=‘“ + userID + “‘“;
sqlCmd = new SqlCommand(sql con);
sqlCmd.ExecuteNonQuery();
con.Close();
return 1;
}
public int getMoney(int Money)
{
int money = 0;
SqlConnection con = new SqlConnection(“server=WTJ-PC\\SQLEXPRESS;database=shop;uid=sa;password=123“);
con.Open();
string sql = “select * from users where userID=‘456‘“;
SqlCommand sqlCmd = new SqlCommand(sql con);
SqlDataReader dr = sqlCmd.ExecuteReader();
if (dr.Read())
{
money = int.Parse(dr[“money“].ToString());
}
con.Close();
money += Money;
con.Open();
sql = “update users set money=‘“ + money + “‘ where userID=‘456‘“;
sqlCmd = new SqlCommand(sql con);
sqlCmd.ExecuteNonQuery();
con.Close();
return 1;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-12-22 03:00 我的购物车\
目录 0 2011-12-22 03:00 我的购物车\Data\
文件 3145728 2011-12-22 03:00 我的购物车\Data\shopping.mdf
文件 1048576 2011-12-22 03:00 我的购物车\Data\shopping_log.ldf
目录 0 2011-12-18 15:14 我的购物车\paid\
目录 0 2011-12-18 15:14 我的购物车\paid\App_Code\
文件 2554 2011-12-06 20:19 我的购物车\paid\App_Code\Service.cs
目录 0 2012-01-20 01:37 我的购物车\paid\App_Data\
文件 87 2008-01-11 20:32 我的购物车\paid\Service.asmx
文件 8068 2011-12-05 10:26 我的购物车\paid\web.config
目录 0 2011-12-24 20:44 我的购物车\shop\
目录 0 2011-12-18 14:50 我的购物车\shop\App_Code\
文件 998 2011-11-20 13:29 我的购物车\shop\App_Code\Goods.cs
文件 1403 2011-11-20 19:19 我的购物车\shop\App_Code\OperateDataba
目录 0 2011-12-18 14:50 我的购物车\shop\App_WebReferences\
目录 0 2011-12-18 14:50 我的购物车\shop\App_WebReferences\localhost\
文件 707 2011-12-06 20:02 我的购物车\shop\App_WebReferences\localhost\Service.disco
文件 578 2011-12-06 20:02 我的购物车\shop\App_WebReferences\localhost\Service.discomap
文件 2955 2011-12-06 20:02 我的购物车\shop\App_WebReferences\localhost\Service.wsdl
文件 595 2011-12-24 20:44 我的购物车\shop\Default.aspx
文件 679 2011-12-24 20:44 我的购物车\shop\Default.aspx.cs
文件 940 2011-11-23 08:11 我的购物车\shop\Global.asax
文件 7112 2011-11-22 21:50 我的购物车\shop\Tshirt.aspx
文件 6240 2011-11-23 08:41 我的购物车\shop\Tshirt.aspx.cs
文件 8024 2011-12-06 20:02 我的购物车\shop\Web.Config
文件 7453 2011-12-05 10:38 我的购物车\shop\car.aspx
文件 5008 2011-12-06 20:11 我的购物车\shop\car.aspx.cs
文件 7110 2011-11-22 21:46 我的购物车\shop\coat.aspx
文件 6238 2011-11-23 08:41 我的购物车\shop\coat.aspx.cs
文件 7109 2011-11-22 21:49 我的购物车\shop\hat.aspx
文件 6236 2011-11-23 08:41 我的购物车\shop\hat.aspx.cs
............此处省略89个文件信息
相关资源
- Asp.net学生信息管理系统源码
- asp.net C#购物车源代码
- ASP.NET实验室预约管理系统
- 020ASP.NET车辆综合管理系统.zip
- c# 高校档案信息管理系统
- asp.net中c#做的躲避小游戏,希望大家
- ASP.NET C# 工资管理系统
- ASP.NET客户管理系统(毕业设计 C#
- 在线求职系统(C#ASP.NET源码)
- asp.net 在线考试系统及论文
- ASP.Net文件上传管理源码
- 《OA企业办公自动化》asp.net 源码(附
- asp.netc#开发规范
- asp.net 大文件上传(带进度条)
- 通过程序自动填充并提交ASP.NET表单(
- ASP.NET 基础编程文档(PPT电子教案)
-
ASP.NET_xm
l深入编程技术 - asp.net 新闻发布系统源码(附文档以及
- asp.net 简单的Ajax应用
- asp.net 企业官网源码(附数据库)
- asp.net 花语花店销售网站源码(含数据
- ASP.NET资产管理系统源码(附数据库)
- ajax 登录(基于asp.net)
- asp.net 简单新闻发布系统源码(附数据
- asp.net新闻发布系统(源码+数据库+论
- asp.net网上购物系统源码
- ASP.NET 在浏览器中预览文件
- asp.net 生命周期
- asp.net 花语花店销售网站源码(附数据
- asp.net 购物车实现(基于Session)
评论
共有 条评论