duhongyu vor 5 Jahren
Ursprung
Commit
486069db68

+ 12 - 4
代码/TVShoppingCallCenter_ZLJ/Controllers/Product/ProductClassController.cs

85
             {
85
             {
86
                 return Error("分类简写重复");
86
                 return Error("分类简写重复");
87
             }
87
             }
88
-            if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId&&b.F_Lock==1) > 0)
88
+            if (input .ParentId>0)
89
             {
89
             {
90
-                return Error("系统锁定分类不允许设置子类");
90
+                if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1) > 0)
91
+                {
92
+                    return Error("系统锁定分类不允许设置子类");
93
+                }
91
             }
94
             }
95
+           
92
 
96
 
93
 
97
 
94
             T_Bus_ProductClass T_Bus_ProductClassModel = new T_Bus_ProductClass();
98
             T_Bus_ProductClass T_Bus_ProductClassModel = new T_Bus_ProductClass();
142
             {
146
             {
143
                 return Error("分类简写重复");
147
                 return Error("分类简写重复");
144
             }
148
             }
145
-            if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1) > 0)
149
+            if (input.ParentId>0)
146
             {
150
             {
147
-                return Error("系统锁定分类不允许设置子类");
151
+                if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1
152
+             ) > 0)
153
+                {
154
+                    return Error("系统锁定分类不允许设置子类");
155
+                }
148
             }
156
             }
149
 
157
 
150
             T_Bus_ProductClass T_Bus_ProductClassModel = await _productClassRepository.GetSingle(a => a.F_ClassId == input.ClassId);
158
             T_Bus_ProductClass T_Bus_ProductClassModel = await _productClassRepository.GetSingle(a => a.F_ClassId == input.ClassId);