}
[OperationContract]
public List
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
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
List
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