|
@@ -33,12 +33,23 @@ namespace MySystem
|
|
|
{
|
|
|
int PosId = int.Parse(function.CheckInt(data));
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
- if(!db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 121))
|
|
|
+ PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
|
|
|
+ if (pos != null)
|
|
|
{
|
|
|
- OpModels.WebCMSEntities spdb = new OpModels.WebCMSEntities();
|
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
|
|
|
- if (pos != null)
|
|
|
+ bool IsGet = true;
|
|
|
+ if(pos.BrandId == 23 || pos.BrandId == 24 || pos.BrandId == 25 || pos.BrandId == 26)
|
|
|
{
|
|
|
+ int Count = db.UserAccountRecord.Count(m => m.QueryCount == PosId && m.ChangeType == 121);
|
|
|
+ int Count1 = db.WifiTradeRecord.Count(m => m.SnNo == pos.PosSn);
|
|
|
+ IsGet = Count >= Count1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ IsGet = db.UserAccountRecord.Any(m => m.QueryCount == PosId && m.ChangeType == 121);
|
|
|
+ }
|
|
|
+ if(!IsGet)
|
|
|
+ {
|
|
|
+ OpModels.WebCMSEntities spdb = new OpModels.WebCMSEntities();
|
|
|
int OpId = 0;
|
|
|
int UserId = pos.BuyUserId;
|
|
|
while(UserId > 0)
|