From 374ce4ffd0c459bb4067e8d5765f972668aff9b1 Mon Sep 17 00:00:00 2001 From: wzp <2040239371@qq.com> Date: 星期四, 02 三月 2023 14:56:23 +0800 Subject: [PATCH] 变更oracle访问组件 --- web/web/GwProduct.ashx | 97 +++++++++++++++++++++++++++++------------------- 1 files changed, 59 insertions(+), 38 deletions(-) diff --git a/web/web/GwProduct.ashx b/web/web/GwProduct.ashx index 829c88d..b8f3d18 100644 --- a/web/web/GwProduct.ashx +++ b/web/web/GwProduct.ashx @@ -88,12 +88,12 @@ if (bean.RouterType == 1) { str1 += "<td rowspan=\"1\"><span class='label label-primary'>閫氶亾</span>"; - str1 += string.Format("<div>绉诲姩锛歿0}</div><div>鐢典俊锛歿1}</div><div>鑱旈�氾細{2}</div>", (object)this.GetOpName(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId)); + str1 += string.Format("<div style='margin-top:10px;'>绉诲姩锛歿0}</div><div>鐢典俊锛歿1}</div><div>鑱旈�氾細{2}</div>", (object)this.GetOpName(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId)); } else if (bean.RouterType == 3) { str1 += "<td rowspan=\"1\"><span class='label label-success'>閫氶亾缁�</span>"; - str1 += string.Format("<div>绉诲姩锛歿0}</div><div>鐢典俊锛歿1}</div><div>鑱旈�氾細{2}</div>", (object)this.GetGroupName(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid)); + str1 += string.Format("<div style='margin-top:10px;'>绉诲姩锛歿0}</div><div>鐢典俊锛歿1}</div><div>鑱旈�氾細{2}</div>", (object)this.GetGroupName(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid)); } else { @@ -266,6 +266,26 @@ 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) { throw new ArgumentException("璇烽�夋嫨绫诲埆锛�"); @@ -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); @@ -447,6 +454,33 @@ int price = 0; int givingNum = 0; + string parentId = context.GetString("parentId", ""); + string path = ""; + + if (id == parentId) + { + throw new ArgumentException("鐖剁骇鍒嗙被id涓嶈兘閫夊綋鍓嶇被鍒紒璇烽噸鏂伴�夋嫨"); + } + + + 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) { throw new ArgumentException("璇烽�夋嫨绫诲埆锛�"); @@ -459,6 +493,11 @@ if (string.IsNullOrEmpty(name)) { throw new ArgumentException(info + "鍚嶇О涓嶈兘涓虹┖锛�"); + } + + if (string.IsNullOrEmpty(parentId)) + { + throw new ArgumentException("鎵�灞炰骇鍝佺被鍒笉鑳戒负绌猴紒"); } } @@ -508,25 +547,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