From dacca6c619f93e827d49454ffc409623f043e421 Mon Sep 17 00:00:00 2001 From: j502647092 Date: Fri, 19 Jun 2015 14:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSQL=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CitySunlight/Admin.aspx.cs | 2 +- CitySunlight/HttpUtils.cs | 3 +-- CitySunlight/Main.aspx.cs | 4 ++-- CitySunlight/Product/ProductEdit.aspx.cs | 6 +++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CitySunlight/Admin.aspx.cs b/CitySunlight/Admin.aspx.cs index 6cd2308..e9b943f 100644 --- a/CitySunlight/Admin.aspx.cs +++ b/CitySunlight/Admin.aspx.cs @@ -51,7 +51,7 @@ namespace CitySunlight String classname = ProductClassManager.getClassName(int.Parse(ProductManager.GetProductInfo(item, ProductManager.Info.Class))); String delete = "删除"; html += ""; - html += HttpUtils.addTd(""); + html += HttpUtils.addTd(); html += HttpUtils.addTd(ProductManager.NameToUrl(id, name)); html += HttpUtils.addTd(picurl); html += HttpUtils.addTd(price); diff --git a/CitySunlight/HttpUtils.cs b/CitySunlight/HttpUtils.cs index 7c6a327..69ee69b 100644 --- a/CitySunlight/HttpUtils.cs +++ b/CitySunlight/HttpUtils.cs @@ -10,7 +10,7 @@ namespace CitySunlight public static String getElementsbyName(String tagName) { if (HttpContext.Current.Request.Form[tagName] != null) - return HttpContext.Current.Request.Form[tagName].ToString().Trim(); + return HttpContext.Current.Request.Form[tagName].ToString().Trim().Replace("'", ""); else return null; } @@ -21,7 +21,6 @@ namespace CitySunlight else return null; } - public static HttpPostedFile getFilebyName(String tagName) { HttpPostedFile file = HttpContext.Current.Request.Files[tagName]; diff --git a/CitySunlight/Main.aspx.cs b/CitySunlight/Main.aspx.cs index 584b571..9e0cce2 100644 --- a/CitySunlight/Main.aspx.cs +++ b/CitySunlight/Main.aspx.cs @@ -28,14 +28,14 @@ namespace CitySunlight return "数据库中未找到产品"; else html += String.Format("{0}", - HttpUtils.addTd("") + + HttpUtils.addTd() + HttpUtils.addTd("商品名称") + HttpUtils.addTd("商品图片") + HttpUtils.addTd("商品价格") + HttpUtils.addTd("商品数量") + HttpUtils.addTd("商品分类") + HttpUtils.addTd("所属卖家") + - HttpUtils.addTd("")); + HttpUtils.addTd()); foreach (DataRow item in items.Rows) { diff --git a/CitySunlight/Product/ProductEdit.aspx.cs b/CitySunlight/Product/ProductEdit.aspx.cs index 019aada..cbd77a6 100644 --- a/CitySunlight/Product/ProductEdit.aspx.cs +++ b/CitySunlight/Product/ProductEdit.aspx.cs @@ -84,7 +84,11 @@ namespace CitySunlight.Product amount = ProductManager.GetProductInfo(id, ProductManager.Info.Amount); classid = ProductManager.GetProductInfo(id, ProductManager.Info.Class); if (username != ProductManager.GetProductInfo(id, ProductManager.Info.UserName)) - return "

你没有修改此商品的权限!

"; + { + this.submit.Visible = false; + return "

你没有修改此商品的权限!

"; + } + } String html = "";