lcl 1 år sedan
förälder
incheckning
23c4022cd9
1 ändrade filer med 21 tillägg och 0 borttagningar
  1. 21 0
      Controllers/HomeController.cs

+ 21 - 0
Controllers/HomeController.cs

@@ -177,6 +177,27 @@ namespace MySystem.Controllers
         public string test1()
         {            
             // ProfitHelper.Instance.DoProfit();
+            List<string> list = new List<string>();
+            list.Add("LKB01230900199998516");
+            WebCMSEntities db = new WebCMSEntities();
+            foreach(string sub in list)
+            {
+                bool op = db.PosMachinesTwo.Any(m => m.PosSn == sub);
+                if(!op)
+                {
+                    //insert into PosMachinesTwo (CreateDate,SourceStoreId,StoreId,PosSn,SourcePosSn) values (now(),2,2,'
+                    db.PosMachinesTwo.Add(new PosMachinesTwo()
+                    {
+                        CreateDate = DateTime.Now,
+                        SourceStoreId = 2,
+                        StoreId = 2,
+                        PosSn = sub,
+                        SourcePosSn = sub,
+                    });
+                    db.SaveChanges();
+                }
+            }
+            db.Dispose();
             return "ok";
         }