public async Task <AjaxResult> AddOrUpdateAsync([FromBody] FunctionInputDto dto)
 {
     if (dto.Id == Guid.Empty)
     {
         return((await _functionService.CreateAsync(dto)).ToAjaxResult());
     }
     return((await _functionService.UpdateAsync(dto)).ToAjaxResult());
 }
 public async Task <OperationResponse> UpdateAsync(FunctionInputDto dto)
 {
     dto.NotNull(nameof(dto));
     return(await _functionRepository.UpdateAsync(dto, async (f, e) => {
         bool isExist = await this.Entities.Where(o => o.Id != f.Id && o.LinkUrl.ToLower() == f.LinkUrl.ToLower()).AnyAsync();
         if (isExist)
         {
             throw new AppException("此功能已存在!!!");
         }
     }));
 }
Example #3
0
 public async Task <OperationResponse> InsertAsync(FunctionInputDto input)
 {
     input.NotNull(nameof(input));
     return(await _functionRepository.InsertAsync(input, async f =>
     {
         bool isExist = await this.Entities.Where(x => x.LinkUrl.ToLower() == input.LinkUrl.ToLower()).AnyAsync();
         if (isExist)
         {
             throw new SuktAppException("此功能已存在!!!");
         }
     }));
 }
 public async Task <AjaxResult> UpdateAsync([FromBody] FunctionInputDto input)
 {
     return((await _function.UpdateAsync(input)).ToAjaxResult());
 }
Example #5
0
 public async Task <AjaxResult> UpdateAsync([FromBody] FunctionInputDto dto)
 {
     return((await _functionService.UpdateAsync(dto)).ToAjaxResult());
 }
 public ActionResult Edit(FunctionInputDto[] dtos)
 {
     dtos.CheckNotNull("dtos" );
     OperationResult result = SecurityContract.EditFunctions(dtos);
     return Json(result.ToAjaxResult());
 }