|
@@ -50,11 +50,12 @@ public class WifiTradeHelper
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
function.WritePage("/wifi/", "trade" + Month + ".txt", DateTime.Now.ToString());
|
|
function.WritePage("/wifi/", "trade" + Month + ".txt", DateTime.Now.ToString());
|
|
|
|
+ string MonthString = Month.Replace("-", "");
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
|
|
MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
|
|
DateTime end = DateTime.Parse(Month + "-01 00:00:00");
|
|
DateTime end = DateTime.Parse(Month + "-01 00:00:00");
|
|
List<string> SnNos = new List<string>();
|
|
List<string> SnNos = new List<string>();
|
|
- List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end).ToList();
|
|
|
|
|
|
+ List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end && m.LastMonth != MonthString).ToList();
|
|
List<MySystem.ReadModels.Users> users = rdb.Users.Where(m => m.AuthFlag == 1).ToList();
|
|
List<MySystem.ReadModels.Users> users = rdb.Users.Where(m => m.AuthFlag == 1).ToList();
|
|
List<string> PosSns = trades.Select(m => m.SnNo).ToList();
|
|
List<string> PosSns = trades.Select(m => m.SnNo).ToList();
|
|
List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => PosSns.Contains(m.PosSn)).ToList();
|
|
List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => PosSns.Contains(m.PosSn)).ToList();
|
|
@@ -173,11 +174,11 @@ public class WifiTradeHelper
|
|
}
|
|
}
|
|
if(edit.LastMonth != Month.Replace("-", ""))
|
|
if(edit.LastMonth != Month.Replace("-", ""))
|
|
{
|
|
{
|
|
- // decimal TradeAmt = edit.TradeAmount / edit.Duration;
|
|
|
|
- // TradeAmt = PublicFunction.NumberFormat(TradeAmt);
|
|
|
|
|
|
+ decimal TradeAmt = edit.TradeAmount / edit.Duration;
|
|
|
|
+ TradeAmt = PublicFunction.NumberFormat(TradeAmt);
|
|
|
|
|
|
- // if(orderCount > 1) TradeAmt = 0.01M;
|
|
|
|
- decimal TradeAmt = 0.01M;
|
|
|
|
|
|
+ if(orderCount > 1) TradeAmt = 0.01M;
|
|
|
|
+ // decimal TradeAmt = 0.01M;
|
|
|
|
|
|
edit.DoMonths += 1;
|
|
edit.DoMonths += 1;
|
|
edit.LastMonth = Month.Replace("-", "");
|
|
edit.LastMonth = Month.Replace("-", "");
|