|
|
@@ -136,26 +136,26 @@ public class WifiTradeHelper
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void DoSomethingNew(string Month)
|
|
|
- {
|
|
|
- WebCMSEntities db = new WebCMSEntities();
|
|
|
- MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
|
|
|
- DateTime end = DateTime.Parse(Month + "-01 00:00:00").AddMonths(1);
|
|
|
- List<string> SnNos = new List<string>();
|
|
|
- List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end).ToList();
|
|
|
- foreach(MySystem.ReadModels.WifiTradeRecord trade in trades)
|
|
|
- {
|
|
|
- if(trade.Unit == "m" && trade.Duration > 0 && !SnNos.Contains(trade.SnNo))
|
|
|
- {
|
|
|
- DoOne(db, trade.Id, Month);
|
|
|
- SnNos.Add(trade.SnNo);
|
|
|
- }
|
|
|
- }
|
|
|
- db.SaveChanges();
|
|
|
- db.Dispose();
|
|
|
- }
|
|
|
+ // public void DoSomethingNew(string Month)
|
|
|
+ // {
|
|
|
+ // WebCMSEntities db = new WebCMSEntities();
|
|
|
+ // MySystem.ReadModels.WebCMSEntities rdb = new MySystem.ReadModels.WebCMSEntities();
|
|
|
+ // DateTime end = DateTime.Parse(Month + "-01 00:00:00").AddMonths(1);
|
|
|
+ // List<string> SnNos = new List<string>();
|
|
|
+ // List<MySystem.ReadModels.WifiTradeRecord> trades = rdb.WifiTradeRecord.Where(m => m.Duration >= m.DoMonths && m.CreateDate < end).ToList();
|
|
|
+ // foreach(MySystem.ReadModels.WifiTradeRecord trade in trades)
|
|
|
+ // {
|
|
|
+ // if(trade.Unit == "m" && trade.Duration > 0 && !SnNos.Contains(trade.SnNo))
|
|
|
+ // {
|
|
|
+ // DoOne(db, trade.Id, Month, "");
|
|
|
+ // SnNos.Add(trade.SnNo);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // db.SaveChanges();
|
|
|
+ // db.Dispose();
|
|
|
+ // }
|
|
|
|
|
|
- public void DoOne(WebCMSEntities db, int Id, string Month, bool time = false)
|
|
|
+ public void DoOne(WebCMSEntities db, int Id, string Month, string OrderNo, bool time = false)
|
|
|
{
|
|
|
WifiTradeRecord edit = db.WifiTradeRecord.FirstOrDefault(m => m.Id == Id);
|
|
|
if(edit != null)
|
|
|
@@ -178,6 +178,7 @@ public class WifiTradeHelper
|
|
|
CreateDate = time ? DateTime.Now : DateTime.Parse(Month + "-01 01:00:00"),
|
|
|
ProductType = edit.BrandId.ToString(),
|
|
|
ErrorMsg = edit.DoMonths == 1 ? edit.TradeAmount.ToString() : "0",
|
|
|
+ ChannelSerial = OrderNo,
|
|
|
});
|
|
|
}
|
|
|
}
|