DuGuYang 2 лет назад
Родитель
Сommit
2b6e4295e9

+ 4 - 53
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -529,20 +529,6 @@ namespace MySystem.Areas.Admin.Controllers
                 BrandId = Convert.ToInt32(Brand);
 
                 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)
                 {
@@ -562,19 +548,8 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 int num = Convert.ToInt32(ApplyList[i]["ApplyNum"].ToString());
                 int BrandIds = Convert.ToInt32(ApplyList[i]["BrandId"].ToString());
-                if (BrandIds == 1) FromStoreId = 7;
-                if (BrandIds == 2) FromStoreId = 721;
-                if (BrandIds == 3) FromStoreId = 697;
-                if (BrandIds == 4) FromStoreId = 774;
-                if (BrandIds == 5) FromStoreId = 775;
-                if (BrandIds == 6) FromStoreId = 871;
-                if (BrandIds == 7) FromStoreId = 1047;
-                if (BrandIds == 8) FromStoreId = 4831;
-                if (BrandIds == 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 == BrandIds) ?? new KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -611,19 +586,8 @@ 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 KqProducts();
+                    FromStoreId = kqProducts.MainStoreId;
                     if (PosSnList.Contains(SnNo))
                     {
                         error += "以下操作失败" + SnNo + ',' + "该机具重复发货" + '\n';
@@ -654,19 +618,6 @@ namespace MySystem.Areas.Admin.Controllers
 
                 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)

+ 6 - 52
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -633,19 +633,7 @@ namespace MySystem.Areas.Admin.Controllers
 
                 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)
                 {
@@ -665,19 +653,9 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 int num = Convert.ToInt32(ApplyList[i]["ApplyNum"].ToString());
                 int BrandIds = Convert.ToInt32(ApplyList[i]["BrandId"].ToString());
-                if (BrandIds == 1) FromStoreId = 7;
-                if (BrandIds == 2) FromStoreId = 721;
-                if (BrandIds == 3) FromStoreId = 697;
-                if (BrandIds == 4) FromStoreId = 774;
-                if (BrandIds == 5) FromStoreId = 775;
-                if (BrandIds == 6) FromStoreId = 871;
-                if (BrandIds == 7) FromStoreId = 1047;
-                if (BrandIds == 8) FromStoreId = 4831;
-                if (BrandIds == 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 == BrandIds) ?? new Models.KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -700,19 +678,7 @@ namespace MySystem.Areas.Admin.Controllers
                 BrandId = Convert.ToInt32(Brand);
                 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)
@@ -771,19 +737,7 @@ namespace MySystem.Areas.Admin.Controllers
 
                 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)

+ 12 - 52
Areas/Admin/Controllers/OperateServer/StoreMachineApplysOperateController.cs

@@ -528,19 +528,9 @@ 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;
+
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -560,19 +550,9 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 int num = Convert.ToInt32(ApplyList[i]["ApplyNum"].ToString());
                 int BrandIds = Convert.ToInt32(ApplyList[i]["BrandId"].ToString());
-                if (BrandIds == 1) FromStoreId = 7;
-                if (BrandIds == 2) FromStoreId = 721;
-                if (BrandIds == 3) FromStoreId = 697;
-                if (BrandIds == 4) FromStoreId = 774;
-                if (BrandIds == 5) FromStoreId = 775;
-                if (BrandIds == 6) FromStoreId = 871;
-                if (BrandIds == 7) FromStoreId = 1047;
-                if (BrandIds == 8) FromStoreId = 4831;
-                if (BrandIds == 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 == BrandIds) ?? new KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -593,19 +573,9 @@ 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 KqProducts();
+                FromStoreId = kqProducts.MainStoreId;
+
                 MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -649,19 +619,9 @@ 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;
+                
                 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)