|
|
@@ -341,11 +341,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
StoreHouse storeHouse = db.StoreHouse.FirstOrDefault(m => m.Id == data.Id);
|
|
|
- if (!string.IsNullOrEmpty(storeHouse.BrandId))
|
|
|
+ var brand = db.StoreHouse.FirstOrDefault(m => m.UserId == storeHouse.UserId && m.BrandId == data.BrandId);
|
|
|
+ if (brand != null)
|
|
|
{
|
|
|
return "您已有该品牌类型的仓库,请重新选择";
|
|
|
}
|
|
|
- if (!string.IsNullOrEmpty(storeHouse.StoreName))
|
|
|
+ var name = db.StoreHouse.FirstOrDefault(m => m.UserId == storeHouse.UserId && m.StoreName == data.StoreName);
|
|
|
+ if (name != null)
|
|
|
{
|
|
|
return "您的仓库名重复,请重新填写";
|
|
|
}
|
|
|
@@ -369,9 +371,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("Remark", data.Remark); //备注
|
|
|
Fields.Add("LimitTopUserId", data.LimitTopUserId); //限制创客特殊仓库
|
|
|
Fields.Add("StoreKind", data.StoreKind); //仓库归属类型
|
|
|
- int bid = int.Parse(storeHouse.BrandId);
|
|
|
+ int bid = Convert.ToInt32(data.BrandId);
|
|
|
KqProducts pro = db.KqProducts.FirstOrDefault(m => m.Id == bid) ?? new KqProducts();
|
|
|
- Fields.Add("BrandId", storeHouse.BrandId);
|
|
|
+ Fields.Add("BrandId", data.BrandId);
|
|
|
Fields.Add("ProductName", pro.Name);
|
|
|
Fields.Add("StoreStatus", 1);
|
|
|
Fields.Add("Status", 1);
|