form编辑

This commit is contained in:
yubaolee 2018-03-06 17:43:40 +08:00
parent 3c9a526df3
commit 41b410ffce
3 changed files with 16 additions and 6 deletions

View File

@ -30,11 +30,16 @@ namespace OpenAuth.App
public void Update(Form obj) public void Update(Form obj)
{ {
UnitWork.Update<Form>(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) public Form FindSingle(string id)

View File

@ -445,9 +445,13 @@ namespace OpenAuth.App
// 数据库名称 // 数据库名称
string tableName="[Form_"+ form.FrmDbId + "]"; string tableName="[Form_"+ form.FrmDbId + "]";
// 创建数据表 // 创建数据表
StringBuilder sql =new StringBuilder("CREATE TABLE " StringBuilder sql =new StringBuilder("if exists ( select * from sysobjects where name = '"
+tableName +tableName+"' and type = 'U') drop table "
+ " ( [Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,") ; //主键 + tableName +";") ;
sql.Append("CREATE TABLE "
+ tableName
+ " ( [Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,"); //主键
string sqlDefault = ""; string sqlDefault = "";

View File

@ -57,6 +57,7 @@ namespace OpenAuth.Mvc.Controllers
//添加或修改 //添加或修改
[System.Web.Mvc.HttpPost] [System.Web.Mvc.HttpPost]
[ValidateInput(false)]
public string Update(Form obj) public string Update(Form obj)
{ {
try try