diff --git a/OpenAuth.App/FormApp.cs b/OpenAuth.App/FormApp.cs index ff0a23be..7adbc692 100644 --- a/OpenAuth.App/FormApp.cs +++ b/OpenAuth.App/FormApp.cs @@ -30,11 +30,16 @@ namespace OpenAuth.App public void Update(Form obj) { - UnitWork.Update
(u => u.Id == obj.Id, u => new Form + Repository.Update(u => u.Id == obj.Id, u => new Form { - //todo:要修改的 + ContentData = obj.ContentData, + Content = obj.Content, + ContentParse = obj.ContentParse, + Name = obj.Name, + FrmDbId = obj.FrmDbId }); + Repository.ExecuteSql(FormUtil.GetSql(obj)); } public Form FindSingle(string id) diff --git a/OpenAuth.App/FormUtil.cs b/OpenAuth.App/FormUtil.cs index 034f332e..7426aaf6 100644 --- a/OpenAuth.App/FormUtil.cs +++ b/OpenAuth.App/FormUtil.cs @@ -445,10 +445,14 @@ namespace OpenAuth.App // 数据库名称 string tableName="[Form_"+ form.FrmDbId + "]"; // 创建数据表 - StringBuilder sql =new StringBuilder("CREATE TABLE " - +tableName - + " ( [Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,") ; //主键 - + StringBuilder sql =new StringBuilder("if exists ( select * from sysobjects where name = '" + +tableName+"' and type = 'U') drop table " + + tableName +";") ; + + sql.Append("CREATE TABLE " + + tableName + + " ( [Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,"); //主键 + string sqlDefault = ""; foreach (var json in jsonArray) diff --git a/OpenAuth.Mvc/Controllers/FormsController.cs b/OpenAuth.Mvc/Controllers/FormsController.cs index 35ea40d4..bee1fcb0 100644 --- a/OpenAuth.Mvc/Controllers/FormsController.cs +++ b/OpenAuth.Mvc/Controllers/FormsController.cs @@ -57,6 +57,7 @@ namespace OpenAuth.Mvc.Controllers //添加或修改 [System.Web.Mvc.HttpPost] + [ValidateInput(false)] public string Update(Form obj) { try