From 3b18a48485f7207438d9d0eb3038d979e069431d Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 26 五月 2022 17:58:18 +0800
Subject: [PATCH] 优化产品及产品分类,订单,对称加密,IP转地区名称

---
 web/web/GwClient.aspx.cs |   60 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 11 deletions(-)

diff --git a/web/web/GwClient.aspx.cs b/web/web/GwClient.aspx.cs
index d4a533f..b8a666f 100644
--- a/web/web/GwClient.aspx.cs
+++ b/web/web/GwClient.aspx.cs
@@ -8,12 +8,15 @@
 using Dao;
 using System.Collections.Generic;
 using System.Text;
+using System.Configuration;
 
 public partial class _GwClient : PageBase<SysUser>, IRequiresSessionState
 {
 
     protected List<SysUser> SysUserList;
     protected List<GwProduct> GwProductList;
+
+    string addressClasses = ConfigurationManager.AppSettings["addressClasses"];
 
     protected void Page_Load(object sender, EventArgs e)
     {
@@ -36,6 +39,7 @@
         {
             GwProduct bean = new GwProduct();
             bean.Classes = 1;
+            bean.IsDefault = -1;
             bean.IsEnable = -1;
             this.GwProductList = gwProductDao.getAllList(bean);
         }
@@ -63,9 +67,9 @@
             }
 
             if (userId == bean.UserID)
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
         }
         return stringBuilder.ToString();
     }
@@ -91,9 +95,9 @@
             }
 
             if (userId == bean.UserID)
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
         }
         return stringBuilder.ToString();
     }
@@ -119,9 +123,9 @@
             }
 
             if (userId == bean.UserID)
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
         }
         return stringBuilder.ToString();
     }
@@ -147,9 +151,9 @@
             }
 
             if (userId == bean.UserID)
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
         }
         return stringBuilder.ToString();
     }
@@ -160,7 +164,7 @@
     {
         StringBuilder stringBuilder = new StringBuilder();
         if (this.GwProductList.Count == 0)
-            return "<option value='0'>鏃�</option>";
+            return "<option value=''>鏃�</option>";
         stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�");
         foreach (GwProduct bean in this.GwProductList)
         {
@@ -176,9 +180,43 @@
             }
 
             if (productId.Equals(bean.Id))
-                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
             else
-                stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name);
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
+        }
+        return stringBuilder.ToString();
+    }
+
+
+    //鑾峰彇涓�т骇鍝佷俊鎭�
+    public string GetPersonalityProductOptions(string productId)
+    {
+        StringBuilder stringBuilder = new StringBuilder();
+        if (this.GwProductList.Count == 0)
+            return "<option value=''>鏃�</option>";
+        stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�");
+        foreach (GwProduct bean in this.GwProductList)
+        {
+            //鍋滅敤鐨勪骇鍝佸垎绫讳笉鍐嶆樉绀�
+            if (bean.IsEnable == 0)
+            {
+                continue;
+            }
+            //杩囨护浜у搧绫诲埆
+            if (bean.Classes == 0)
+            {
+                continue;
+            }
+            //杩囨护鎺ㄥ箍鏂瑰紡
+            if (bean.IsDefault == 1)
+            {
+                continue;
+            }
+
+            if (productId.Equals(bean.Id))
+                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.Id, (object)bean.Name);
+            else
+                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.Id, (object)bean.Name);
         }
         return stringBuilder.ToString();
     }

--
Gitblit v1.9.1