|
@@ -5,6 +5,7 @@ using Datory;
|
|
|
using GxPress.Common.AppOptions;
|
|
|
using GxPress.Common.Tools;
|
|
|
using GxPress.Repository.Interface.Navigation;
|
|
|
+using GxPress.Request.Navigation;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
namespace GxPress.Repository.Implement.Navigation
|
|
@@ -45,9 +46,28 @@ namespace GxPress.Repository.Implement.Navigation
|
|
|
return await _repository.InsertAsync(note);
|
|
|
}
|
|
|
|
|
|
- public async Task<bool> UpdateAsync(Entity.Navigations.Navigation note)
|
|
|
+ public async Task<bool> UpdateAsync(NavigationInRequest request)
|
|
|
{
|
|
|
- return await _repository.UpdateAsync(note);
|
|
|
+ if (request.Id > 0)
|
|
|
+ {
|
|
|
+ var model = await GetAsync(request.Id);
|
|
|
+ if (request.IsDisable > 0)
|
|
|
+ model.IsDisable = request.IsDisable == 1;
|
|
|
+ if (request.Isoperate > 0)
|
|
|
+ model.Isoperate = request.Isoperate == 1;
|
|
|
+ if (request.MiddleLableId > 0)
|
|
|
+ model.MiddleLableId = request.MiddleLableId;
|
|
|
+ if (!string.IsNullOrEmpty(request.Name))
|
|
|
+ model.Name = request.Name;
|
|
|
+ if (request.ParentId > 0)
|
|
|
+ model.ParentId = request.ParentId;
|
|
|
+ if (request.Sort > 0)
|
|
|
+ model.Sort = request.Sort;
|
|
|
+ if (request.Terminal > 0)
|
|
|
+ model.Terminal = request.Terminal;
|
|
|
+ return await _repository.UpdateAsync(model);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
public async Task<bool> UpdateAsync(SqlKata.Query query)
|
|
|
{
|