check bugs

This commit is contained in:
yubaolee
2018-03-28 17:35:43 +08:00
parent 0b4dfcd429
commit b01e8aadcc
7 changed files with 100 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
using Infrastructure;
using System;
using Infrastructure;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.Repository.Domain;
@@ -15,38 +16,47 @@ namespace OpenAuth.App
/// </summary>
public TableData Load(QueryFormListReq request)
{
return new TableData
{
count = Repository.GetCount(null),
data = Repository.Find(request.page, request.limit,"CreateDate desc")
data = Repository.Find(request.page, request.limit, "CreateDate desc")
};
}
public void Add(Form obj)
{
UnitWork.Add(obj);
UnitWork.ExecuteSql(FormUtil.GetSql(obj));
if (!string.IsNullOrEmpty(obj.DbName))
{
UnitWork.ExecuteSql(FormUtil.GetSql(obj));
}
UnitWork.Save();
}
public void Update(Form obj)
{
Repository.Update(u => u.Id == obj.Id, u => new Form
{
ContentData = obj.ContentData,
Content = obj.Content,
ContentParse = obj.ContentParse,
Name = obj.Name,
DbName = obj.DbName
ContentData = obj.ContentData,
Content = obj.Content,
ContentParse = obj.ContentParse,
Name = obj.Name,
DbName = obj.DbName,
SortCode = obj.SortCode,
Description = obj.Description,
ModifyDate = DateTime.Now
});
Repository.ExecuteSql(FormUtil.GetSql(obj));
if (!string.IsNullOrEmpty(obj.DbName))
{
UnitWork.ExecuteSql(FormUtil.GetSql(obj));
}
}
public FormResp FindSingle(string id)
{
var form = Get(id);
var form = Get(id);
return form.MapTo<FormResp>();
}