资源简介
自己做的ASP.NET网上商城,用了LINQ+三层架构+SQL2008,分层绝对清晰,代码也很容易看懂,适合学习,有问题可以M我QQ934390119,下了绝对不亏
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entity;
using System.Collections;
namespace AccessTask
{
public class GoodsDBClass
{
NetStoreDataContext db = new NetStoreDataContext();
//获得商品信息
public GoodsInfo getGoodsInfo(int GoodsID) {
GoodsInfo goods = null;
var goodsInformation = from r in db.tb_BookInfo
where r.BookID == GoodsID
select r;
foreach (var r in goodsInformation) {
goods.ClassID = r.ClassID;
goods.GoodName = r.BookName;
goods.GoodIntroduce = r.BookIntroduce;
goods.Author = r.Author;
goods.Company = r.Company;
goods.GoodsUrl = r.BookUrl;
goods.MarketPrice = r.MarketPrice;
goods.HotPrice = r.HotPrice;
goods.Isrefinement = r.Isrefinement;
goods.IsHot = r.IsHot;
goods.IsDiscount = r.IsDiscount;
}
return goods;
}
//获得全部商品
public IList GetAllGoods() {
List GoodsList = new List();
var results = from c in db.tb_BookInfo
select c;
foreach (var r in results)
{
GoodsInfo goods = new GoodsInfo();
goods.GoodsID = r.BookID;
goods.ClassID = r.ClassID;
goods.GoodName = r.BookName;
goods.GoodIntroduce = r.BookIntroduce;
goods.Author = r.Author;
goods.Company = r.Company;
goods.GoodsUrl = r.BookUrl;
goods.MarketPrice = r.MarketPrice;
goods.HotPrice = r.HotPrice;
goods.Isrefinement = r.Isrefinement;
goods.IsHot = r.IsHot;
goods.IsDiscount = r.IsDiscount;
GoodsList.Add(goods);
}
return GoodsList;
}
//获得部分商品信息
public ArrayList GetDataSetStr(int GoodsID) {
ArrayList list = new ArrayList();
var result = from r in db.tb_BookInfo
where r.BookID == GoodsID
select new
{
r.BookName
r.HotPrice
};
foreach (var c in result) {
list.Add(c.BookName);
list.Add(c.HotPrice);
}
return list;
}
//添加新的商品
public void InsertGoods(GoodsInfo goods) {
tb_BookInfo Good = new tb_BookInfo();
Good.ClassID = goods.ClassID;
Good.BookName = goods.GoodName;
Good.BookIntroduce = goods.Goo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-02-05 13:18 OnlineShop(完整版)\
目录 0 2018-01-12 09:52 OnlineShop(完整版)\.vs\
目录 0 2018-01-12 09:52 OnlineShop(完整版)\.vs\config\
文件 85861 2018-01-10 12:09 OnlineShop(完整版)\.vs\config\applicationhost.config
目录 0 2018-01-12 09:52 OnlineShop(完整版)\.vs\OnlineShop(完整版)\
目录 0 2018-01-12 09:52 OnlineShop(完整版)\.vs\OnlineShop(完整版)\v14\
文件 131072 2018-01-10 13:35 OnlineShop(完整版)\.vs\OnlineShop(完整版)\v14\.suo
目录 0 2018-01-12 09:52 OnlineShop(完整版)\AccessTask\
文件 3926 2018-01-04 20:03 OnlineShop(完整版)\AccessTask\AccessTask.csproj
文件 659 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\app.config
目录 0 2018-01-12 09:52 OnlineShop(完整版)\AccessTask\bin\
目录 0 2018-01-12 09:52 OnlineShop(完整版)\AccessTask\bin\Debug\
文件 61952 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\bin\Debug\AccessTask.dll
文件 659 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\bin\Debug\AccessTask.dll.config
文件 159232 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\bin\Debug\AccessTask.pdb
文件 11776 2018-01-09 19:46 OnlineShop(完整版)\AccessTask\bin\Debug\Entity.dll
文件 50688 2018-01-09 19:46 OnlineShop(完整版)\AccessTask\bin\Debug\Entity.pdb
文件 29344 2018-01-04 20:04 OnlineShop(完整版)\AccessTask\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
文件 1805 2018-01-04 20:04 OnlineShop(完整版)\AccessTask\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xm
目录 0 2018-01-04 19:43 OnlineShop(完整版)\AccessTask\bin\Release\
文件 6735 2018-01-05 11:29 OnlineShop(完整版)\AccessTask\GoodsDBClass.cs
文件 2407 2018-01-05 15:45 OnlineShop(完整版)\AccessTask\LeaveWordDBClass.cs
文件 3010 2018-01-05 12:16 OnlineShop(完整版)\AccessTask\MemberDBClass.cs
文件 24387 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\NetStore.dbml
文件 5888 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\NetStore.dbml.layout
文件 95879 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\NetStore.designer.cs
目录 0 2018-01-12 09:52 OnlineShop(完整版)\AccessTask\obj\
目录 0 2018-01-12 09:52 OnlineShop(完整版)\AccessTask\obj\Debug\
文件 1184 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\obj\Debug\AccessTask.csproj.FileListAbsolute.txt
文件 6803 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\obj\Debug\AccessTask.csprojResolveAssemblyReference.cache
文件 61952 2018-01-10 12:14 OnlineShop(完整版)\AccessTask\obj\Debug\AccessTask.dll
............此处省略541个文件信息
评论
共有 条评论