Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
This commit is contained in:
@@ -8,6 +8,8 @@ using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
/// <summary>
|
||||
@@ -49,6 +51,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<IResponseOutput> AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate)
|
||||
{
|
||||
addOrEditUserWLTemplate.UserId = _userInfo.Id;
|
||||
if (addOrEditUserWLTemplate.Id == null)
|
||||
{
|
||||
var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync();
|
||||
if (count >= 10)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UserWLTS_MaxTemplate"]);
|
||||
}
|
||||
|
||||
}
|
||||
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user