DuGuYang 2 роки тому
батько
коміт
4624aaeeda

+ 30 - 26
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -528,19 +528,21 @@ namespace MySystem.Areas.Admin.Controllers
 
                 BrandId = Convert.ToInt32(Brand);
 
-                if (BrandId == 1) FromStoreId = 7;
-                if (BrandId == 2) FromStoreId = 721;
-                if (BrandId == 3) FromStoreId = 697;
-                if (BrandId == 4) FromStoreId = 774;
-                if (BrandId == 5) FromStoreId = 775;
-                if (BrandId == 6) FromStoreId = 871;
-                if (BrandId == 7) FromStoreId = 1047;
-                if (BrandId == 8) FromStoreId = 4831;
-                if (BrandId == 9) FromStoreId = 4832;
-                if (BrandId == 10) FromStoreId = 5512;
-                if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 5907;
-                if (BrandId == 13) FromStoreId = 6381;
+                var kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+                // if (BrandId == 1) FromStoreId = 7;
+                // if (BrandId == 2) FromStoreId = 721;
+                // if (BrandId == 3) FromStoreId = 697;
+                // if (BrandId == 4) FromStoreId = 774;
+                // if (BrandId == 5) FromStoreId = 775;
+                // if (BrandId == 6) FromStoreId = 871;
+                // if (BrandId == 7) FromStoreId = 1047;
+                // if (BrandId == 8) FromStoreId = 4831;
+                // if (BrandId == 9) FromStoreId = 4832;
+                // if (BrandId == 10) FromStoreId = 5512;
+                // if (BrandId == 11) FromStoreId = 5513;
+                // if (BrandId == 12) FromStoreId = 5907;
+                // if (BrandId == 13) FromStoreId = 6381;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -650,19 +652,21 @@ namespace MySystem.Areas.Admin.Controllers
 
                 BrandId = Convert.ToInt32(Brand);
 
-                if (BrandId == 1) FromStoreId = 7;
-                if (BrandId == 2) FromStoreId = 721;
-                if (BrandId == 3) FromStoreId = 697;
-                if (BrandId == 4) FromStoreId = 774;
-                if (BrandId == 5) FromStoreId = 775;
-                if (BrandId == 6) FromStoreId = 871;
-                if (BrandId == 7) FromStoreId = 1047;
-                if (BrandId == 8) FromStoreId = 4831;
-                if (BrandId == 9) FromStoreId = 4832;
-                if (BrandId == 10) FromStoreId = 5512;
-                if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 5907;
-                if (BrandId == 13) FromStoreId = 6381;
+                var kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+                // if (BrandId == 1) FromStoreId = 7;
+                // if (BrandId == 2) FromStoreId = 721;
+                // if (BrandId == 3) FromStoreId = 697;
+                // if (BrandId == 4) FromStoreId = 774;
+                // if (BrandId == 5) FromStoreId = 775;
+                // if (BrandId == 6) FromStoreId = 871;
+                // if (BrandId == 7) FromStoreId = 1047;
+                // if (BrandId == 8) FromStoreId = 4831;
+                // if (BrandId == 9) FromStoreId = 4832;
+                // if (BrandId == 10) FromStoreId = 5512;
+                // if (BrandId == 11) FromStoreId = 5513;
+                // if (BrandId == 12) FromStoreId = 5907;
+                // if (BrandId == 13) FromStoreId = 6381;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status > -1 && m.Sort == 0);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 45 - 39
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -631,19 +631,21 @@ namespace MySystem.Areas.Admin.Controllers
 
                 BrandId = Convert.ToInt32(Brand);
 
-                if (BrandId == 1) FromStoreId = 7;
-                if (BrandId == 2) FromStoreId = 721;
-                if (BrandId == 3) FromStoreId = 697;
-                if (BrandId == 4) FromStoreId = 774;
-                if (BrandId == 5) FromStoreId = 775;
-                if (BrandId == 6) FromStoreId = 871;
-                if (BrandId == 7) FromStoreId = 1047;
-                if (BrandId == 8) FromStoreId = 4831;
-                if (BrandId == 9) FromStoreId = 4832;
-                if (BrandId == 10) FromStoreId = 5512;
-                if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 5907;
-                if (BrandId == 13) FromStoreId = 6381;
+                var kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new Models.KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+                // if (BrandId == 1) FromStoreId = 7;
+                // if (BrandId == 2) FromStoreId = 721;
+                // if (BrandId == 3) FromStoreId = 697;
+                // if (BrandId == 4) FromStoreId = 774;
+                // if (BrandId == 5) FromStoreId = 775;
+                // if (BrandId == 6) FromStoreId = 871;
+                // if (BrandId == 7) FromStoreId = 1047;
+                // if (BrandId == 8) FromStoreId = 4831;
+                // if (BrandId == 9) FromStoreId = 4832;
+                // if (BrandId == 10) FromStoreId = 5512;
+                // if (BrandId == 11) FromStoreId = 5513;
+                // if (BrandId == 12) FromStoreId = 5907;
+                // if (BrandId == 13) FromStoreId = 6381;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -696,19 +698,21 @@ namespace MySystem.Areas.Admin.Controllers
                 string SnNo = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
                 string Brand = itemJson.Contains("\"B\"") ? dr["B"].ToString() : "";
                 BrandId = Convert.ToInt32(Brand);
-                if (BrandId == 1) FromStoreId = 7;
-                if (BrandId == 2) FromStoreId = 721;
-                if (BrandId == 3) FromStoreId = 697;
-                if (BrandId == 4) FromStoreId = 774;
-                if (BrandId == 5) FromStoreId = 775;
-                if (BrandId == 6) FromStoreId = 871;
-                if (BrandId == 7) FromStoreId = 1047;
-                if (BrandId == 8) FromStoreId = 4831;
-                if (BrandId == 9) FromStoreId = 4832;
-                if (BrandId == 10) FromStoreId = 5512;
-                if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 5907;
-                if (BrandId == 13) FromStoreId = 6381;
+                var kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new Models.KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+                // if (BrandId == 1) FromStoreId = 7;
+                // if (BrandId == 2) FromStoreId = 721;
+                // if (BrandId == 3) FromStoreId = 697;
+                // if (BrandId == 4) FromStoreId = 774;
+                // if (BrandId == 5) FromStoreId = 775;
+                // if (BrandId == 6) FromStoreId = 871;
+                // if (BrandId == 7) FromStoreId = 1047;
+                // if (BrandId == 8) FromStoreId = 4831;
+                // if (BrandId == 9) FromStoreId = 4832;
+                // if (BrandId == 10) FromStoreId = 5512;
+                // if (BrandId == 11) FromStoreId = 5513;
+                // if (BrandId == 12) FromStoreId = 5907;
+                // if (BrandId == 13) FromStoreId = 6381;
                 Models.MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new Models.MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new Models.PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -765,19 +769,21 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                 }
 
-                if (BrandId == 1) FromStoreId = 7;
-                if (BrandId == 2) FromStoreId = 721;
-                if (BrandId == 3) FromStoreId = 697;
-                if (BrandId == 4) FromStoreId = 774;
-                if (BrandId == 5) FromStoreId = 775;
-                if (BrandId == 6) FromStoreId = 871;
-                if (BrandId == 7) FromStoreId = 1047;
-                if (BrandId == 8) FromStoreId = 4831;
-                if (BrandId == 9) FromStoreId = 4832;
-                if (BrandId == 10) FromStoreId = 5512;
-                if (BrandId == 11) FromStoreId = 5513;
-                if (BrandId == 12) FromStoreId = 5907;
-                if (BrandId == 13) FromStoreId = 6381;
+                var kqProducts = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new Models.KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+                // if (BrandId == 1) FromStoreId = 7;
+                // if (BrandId == 2) FromStoreId = 721;
+                // if (BrandId == 3) FromStoreId = 697;
+                // if (BrandId == 4) FromStoreId = 774;
+                // if (BrandId == 5) FromStoreId = 775;
+                // if (BrandId == 6) FromStoreId = 871;
+                // if (BrandId == 7) FromStoreId = 1047;
+                // if (BrandId == 8) FromStoreId = 4831;
+                // if (BrandId == 9) FromStoreId = 4832;
+                // if (BrandId == 10) FromStoreId = 5512;
+                // if (BrandId == 11) FromStoreId = 5513;
+                // if (BrandId == 12) FromStoreId = 5907;
+                // if (BrandId == 13) FromStoreId = 6381;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)