|
|
@ -39,7 +39,7 @@ namespace Myshipping.Application
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
.Where(m => m.CreatedUserId == UserManager.UserId)
|
|
|
|
.Where(m => m.CreatedUserId == UserManager.UserId)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
|
|
|
|
.WhereIF(input.Type.HasValue, u => u.Type == input.Type)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Type), u =>u.Type.Contains(input.Type))
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
return entities.XnPagedResult();
|
|
|
|
return entities.XnPagedResult();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -52,7 +52,7 @@ namespace Myshipping.Application
|
|
|
|
[HttpPost("/BookingTemplate/add")]
|
|
|
|
[HttpPost("/BookingTemplate/add")]
|
|
|
|
public async Task Add(AddBookingTemplateInput input)
|
|
|
|
public async Task Add(AddBookingTemplateInput input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var c = _rep.Count(x => x.Type == input.Type && x.Title == input.Title);
|
|
|
|
var c = _rep.Count(x => x.Type.Contains(input.Type) && x.Title == input.Title);
|
|
|
|
if (c > 0)
|
|
|
|
if (c > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Oh(BookingErrorCode.BOOK101);
|
|
|
|
throw Oops.Oh(BookingErrorCode.BOOK101);
|
|
|
|