|
@@ -631,19 +631,21 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
|
|
BrandId = Convert.ToInt32(Brand);
|
|
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);
|
|
CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
|
|
|
if (items == null)
|
|
if (items == null)
|
|
|
{
|
|
{
|
|
@@ -696,19 +698,21 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string SnNo = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
|
|
string SnNo = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
|
|
|
string Brand = itemJson.Contains("\"B\"") ? dr["B"].ToString() : "";
|
|
string Brand = itemJson.Contains("\"B\"") ? dr["B"].ToString() : "";
|
|
|
BrandId = Convert.ToInt32(Brand);
|
|
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();
|
|
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();
|
|
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)
|
|
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);
|
|
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);
|
|
SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
|
|
|
if (item == null)
|
|
if (item == null)
|