Browse Source

解绑队列,删除商户

lichunlei 2 years ago
parent
commit
31c6beec49
1 changed files with 6 additions and 6 deletions
  1. 6 6
      AppStart/Helper/SycnSpServer/SycnSpUnBindService.cs

+ 6 - 6
AppStart/Helper/SycnSpServer/SycnSpUnBindService.cs

@@ -45,15 +45,15 @@ namespace MySystem
                             {
                                 if (forMerNo != null)
                                 {
+                                    // 删除对应商户
+                                    PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
+                                    if(merchant != null)
+                                    {
+                                        db.PosMerchantInfo.Remove(merchant);
+                                    }
                                     db.MachineForMerNo.Remove(forMerNo);
                                     db.SaveChanges();
                                 }
-                                // 删除对应商户
-                                PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
-                                if(merchant != null)
-                                {
-                                    db.PosMerchantInfo.Remove(merchant);
-                                }
                                 db.MachineUnBind.Add(new PxcModels.MachineUnBind()
                                 {
                                     CreateDate = DateTime.Now,