|
|
|
@ -94,9 +94,7 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
|
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
if (ent.CreateBy != null) |
|
|
|
|
ent.CreateBy = userId; |
|
|
|
|
ent.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
|
|
ent.CreateIP = ip; |
|
|
|
|
ent.CreateProg = api; |
|
|
|
|
|
|
|
|
@ -117,10 +115,7 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
listEntity.ForEach(entity => |
|
|
|
|
{ |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
if (ent.CreateBy != null) |
|
|
|
|
ent.CreateBy = userId; |
|
|
|
|
ent.CreateTime = DateTime.Now; |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
ent.CreateIP = ip; |
|
|
|
|
ent.CreateProg = api; |
|
|
|
|
}); |
|
|
|
@ -134,8 +129,7 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
/// <param name="entity">博文实体类</param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<bool> Update(long Id, TEditDto editModel) |
|
|
|
|
{ |
|
|
|
|
var userId = UserContext.Current.User_Id; |
|
|
|
|
{ |
|
|
|
|
HttpRequest request = UserContext.Context.Request; |
|
|
|
|
var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
@ -146,8 +140,6 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
var entity = await BaseDal.QueryById(Id); |
|
|
|
|
ConvertTEditDto2TEntity(editModel, entity); |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
ent.UpdateBy = userId; |
|
|
|
|
ent.UpdateTime = DateTime.Now; |
|
|
|
|
ent.UpdateIP = ip; |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
return await BaseDal.Update(entity); |
|
|
|
@ -159,16 +151,12 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<bool> Update(List<TEntity> listEntity) |
|
|
|
|
{ |
|
|
|
|
var userId = UserContext.Current.User_Id; |
|
|
|
|
HttpRequest request = UserContext.Context.Request; |
|
|
|
|
var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
listEntity.ForEach(entity => |
|
|
|
|
{ |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
if (ent.UpdateBy != null) |
|
|
|
|
ent.UpdateBy = userId; |
|
|
|
|
ent.UpdateTime = DateTime.Now; |
|
|
|
|
ent.UpdateIP = ip; |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
}); |
|
|
|
@ -176,15 +164,11 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<bool> Update(TEntity entity, string where) |
|
|
|
|
{ |
|
|
|
|
var userId = UserContext.Current.User_Id; |
|
|
|
|
{ |
|
|
|
|
HttpRequest request = UserContext.Context.Request; |
|
|
|
|
var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
if (ent.UpdateBy != null) |
|
|
|
|
ent.UpdateBy = userId; |
|
|
|
|
ent.UpdateTime = DateTime.Now; |
|
|
|
|
ent.UpdateIP = ip; |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
return await BaseDal.Update(entity, where); |
|
|
|
|