团购网站系统说明书(8)

2020-02-20 22:55

}

[OperationContract]

public List GetBSInfoData(int g) {

List list = new List();

using (tgNetEntities3 en = new tgNetEntities3()) {

int i = en.tgNetBSInfo.Where(n => n.sellerID == g).Count(); if (i != 0) {

var sel = en.tgNetBSInfo.Where(n => n.sellerID == g); foreach (var e in sel) {

BSInfo bsi = new BSInfo(); bsi._baddress = e.baddress; bsi._listID = e.listID; bsi._pname = e.pname; bsi._pnmu = (int)e.pnum; bsi._prc = (float)e.prc; bsi._tgprc = (float)e.tgprc; bsi._buyerID = (int)e.buyerID;

//cmt._buyerName = en.tgNetBLogInfo.Where(n => n.buyerID == cmt._buyerID).First().bname;

list.Add(bsi); }

return list; } else {

return null; } } }

[OperationContract]

public List GetCommContentData(int i)//卖家读取评论内容 { List list = new List(); using (tgNetEntities3 en = new tgNetEntities3()) {

int j = en.tgNetComm.Where(n => n.sellerID == i).Count(); if (j != 0) {

36

foreach (var e in en.tgNetComm) {

Comment cmt = new Comment(); cmt._commContent = e.commContent; cmt._buyerID = (int)e.buyerID; cmt._mark = e.mark;

cmt._sellerID = (int)e.sellerID;

cmt._buyerName = en.tgNetBLogInfo.Where(n => n.buyerID == cmt._buyerID).First().bname;

list.Add(cmt); }

return list; } else {

return null; } } }

[OperationContract]

public List GetGWCData(int g) {

List list = new List(); using (tgNetEntities3 en = new tgNetEntities3()) {

int i = en.tgNetBCar.Where(n => n.buyerID == g).Count(); if (i != 0) {

var sel = en.tgNetBCar.Where(n => n.buyerID == g); //int i = (int)sel.pid;//得ì?到ì?商|¨?品?¤号? //int j = (int)sel.bcarID; foreach (var e in sel) {

GWCType st = new GWCType(); st._bcarID = e.bcarID;

st._pnum = 1;//设|¨¨置?购o买¨°数oy量¢?为a1 st._pname = e.pname; st._prc = (float)e.prc; //st._seller = e.seller; st._pdisc = e.pdisc;

//st._photoPath = e.photoPath; st._tgprc = (float)e.tgprc; st._status = e.status; list.Add(st);

37

}

return list; } else {

return null; } } }

[OperationContract]

public void DeleteLog(int g) {

using (tgNetEntities3 en = new tgNetEntities3()) {

GWCType st = new GWCType();

//st._bcarID = en.tgNetBCar.bcarID;

int i = en.tgNetBCar.Where(s => s.bcarID == g).Count(); if(i != 0) {

var sel = en.tgNetBCar.FirstOrDefault(s => s.bcarID == g); en.DeleteObject(sel); en.SaveChanges(); } } }

[OperationContract]

public int GetBuyerID(string g) {

using (tgNetEntities3 en = new tgNetEntities3()) {

int i = en.tgNetBLogInfo.Where(n => n.uemail == g).Count(); if (i != 0) {

var sel = en.tgNetBLogInfo.Where(n => n.uemail == g).First(); //tgNetBLogInfo t = new tgNetBLogInfo(); //BuyerType b;

//b._buyerID = t.buyerID; return sel.buyerID; } else {

return 0; }

38

} }

[OperationContract]

public string GetBuyerbname(int i)//获取买家的呢称? {

using (tgNetEntities3 en = new tgNetEntities3()) {

int j = en.tgNetBLogInfo.Where(n => n.buyerID == i).Count(); if (j != 0) {

var sel = en.tgNetBLogInfo.Where(n => n.buyerID == i).First(); //tgNetBLogInfo t = new tgNetBLogInfo(); //BuyerType b;

//b._buyerID = t.buyerID; return sel.bname; } else {

return null; } } }

[OperationContract]

public string GetSellerbname(int i)//获取卖家的呢称 { using (tgNetEntities3 en = new tgNetEntities3()) {

int j = en.tgNetSLogInfo.Where(n => n.sellerID == i).Count(); if (j != 0) {

var sel = en.tgNetSLogInfo.Where(n => n.sellerID == i).First(); //tgNetBLogInfo t = new tgNetBLogInfo(); //BuyerType b;

//b._buyerID = t.buyerID; return sel.sname; } else {

return null; } } }

[OperationContract]

public int GetSellerID(string g)

39

{

using (tgNetEntities3 en = new tgNetEntities3()) {

int i = en.tgNetSLogInfo.Where(n => n.uemail == g).Count(); if (i != 0) {

var sel = en.tgNetSLogInfo.Where(n => n.uemail == g).First(); return sel.sellerID; } else {

return 0; } } }

[OperationContract]

public string GetTotalPrice(int i) {

using (tgNetEntities3 en = new tgNetEntities3()) {

int j = en.tgNetBCar.Where(n => n.buyerID == i).Count(); //var sel = en.tgNetBCar.Sum(n=>n.tgprc);

var sel = en.tgNetBCar.Where(n => n.buyerID == i); if (j != 0) {

int s = (int)sel.Sum(n => n.tgprc); string t = s.ToString(); return t; } else {

return null; } } }

[OperationContract]

public List GetTradInfData(int i) {

List list = new List(); using (tgNetEntities3 en = new tgNetEntities3()) {

int j = en.tgNetBSInfo.Where(n => n.buyerID == i).Count();

40


团购网站系统说明书(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:一些美语常用到的口头语 Microsoft Word 文档(6)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: