From 02fe59564a19996974a9d36be6ab61f29ee4c004 Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期三, 02 十一月 2022 17:06:36 +0800
Subject: [PATCH] 修复好几个bug
---
web/web/GwProduct.ashx | 86 +++++++++++++++++++++++++------------------
1 files changed, 50 insertions(+), 36 deletions(-)
diff --git a/web/web/GwProduct.ashx b/web/web/GwProduct.ashx
index 829c88d..c6048c6 100644
--- a/web/web/GwProduct.ashx
+++ b/web/web/GwProduct.ashx
@@ -265,6 +265,26 @@
int ctGroupid = 0;
int price = 0;
int givingNum = 0;
+
+ string parentId = context.GetString("parentId", "");
+ string path = "";
+ if (string.IsNullOrEmpty(parentId) )
+ {
+ path = "0";
+ }
+ else
+ {
+ GwProduct newProduct = _Dao.Get(parentId);
+ if(newProduct!=null)
+ {
+ path = newProduct.Path=="" ? "0" : newProduct.Path + "," + newProduct.Id ;
+ }
+ else
+ {
+ path = "0";
+ }
+
+ }
string info = "" ;
if (classes == -1) {
@@ -278,6 +298,11 @@
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException(info + "鍚嶇О涓嶈兘涓虹┖锛�");
+ }
+
+ if (string.IsNullOrEmpty(parentId))
+ {
+ throw new ArgumentException("鎵�灞炰骇鍝佺被鍒笉鑳戒负绌猴紒");
}
}
@@ -326,25 +351,7 @@
}
}
- string parentId = context.GetString("parentId", "0");
- string path = "";
- if (parentId.Equals("0"))
- {
- path = "0";
- }
- else
- {
- GwProduct newProduct = _Dao.Get(parentId);
- if(newProduct!=null)
- {
- path = newProduct.Path=="" ? "0" : newProduct.Path + "," + newProduct.Id ;
- }
- else
- {
- path = "0";
- }
- }
int isEnable = context.GetInt("isEnable", 0);
//int price = context.GetInt("price", 0);
@@ -446,6 +453,26 @@
int ctGroupid = 0;
int price = 0;
int givingNum = 0;
+
+ string parentId = context.GetString("parentId", "");
+ string path = "";
+ if (string.IsNullOrEmpty(parentId) )
+ {
+ path = "0";
+ }
+ else
+ {
+ GwProduct newProduct = _Dao.Get(parentId);
+ if(newProduct!=null)
+ {
+ path = newProduct.Path=="" ? "0" : newProduct.Path + "," + newProduct.Id ;
+ }
+ else
+ {
+ path = "0";
+ }
+
+ }
string info = "" ;
if (classes == -1) {
@@ -459,6 +486,11 @@
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException(info + "鍚嶇О涓嶈兘涓虹┖锛�");
+ }
+
+ if (string.IsNullOrEmpty(parentId))
+ {
+ throw new ArgumentException("鎵�灞炰骇鍝佺被鍒笉鑳戒负绌猴紒");
}
}
@@ -508,25 +540,7 @@
}
}
- string parentId = context.GetString("parentId", "0");
- string path = "";
- if (parentId.Equals("0"))
- {
- path = "0";
- }
- else
- {
- GwProduct newProduct = _Dao.Get(parentId);
- if(newProduct!=null)
- {
- path = newProduct.Path=="" ? "0" : newProduct.Path + "," + newProduct.Id ;
- }
- else
- {
- path = "0";
- }
- }
int isEnable = context.GetInt("isEnable", 0);
string remark = context.GetString("remark", "");
--
Gitblit v1.9.1