Răsfoiți Sursa

wifi解绑逻辑完成,待测试

lcl 6 luni în urmă
părinte
comite
6c0c873cc5
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      AppStart/WifiUnBindHelper.cs

+ 4 - 4
AppStart/WifiUnBindHelper.cs

@@ -31,9 +31,7 @@ public class WifiUnBindHelper
                 string content = RedisDbconn.Instance.RPop<string>("WifiUnBindQueue");
                 if(!string.IsNullOrEmpty(content))
                 {
-                    WebCMSEntities db = new WebCMSEntities();
-                    DoSomething(db, content);
-                    db.Dispose();
+                    DoSomething(content);
                 }
                 else
                 {
@@ -47,8 +45,9 @@ public class WifiUnBindHelper
         }
     }
 
-    public void DoSomething(WebCMSEntities db, string SnNo)
+    public void DoSomething(string SnNo)
     {
+        WebCMSEntities db = new WebCMSEntities();
         PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == SnNo) ?? new PosMachinesTwo();
         PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
         if(merchant != null)
@@ -91,5 +90,6 @@ public class WifiUnBindHelper
             }
             db.SaveChanges();
         }
+        db.Dispose();
     }
 }