Exemple #1
0
        public async Task <IActionResult> Delete(long fileId)
        {
            try
            {
                var file = await getFileService.GetById(fileId, false);

                if (file == null)
                {
                    return(NotFound());
                }

                await deleteFileService.Delete(file);

                return(NoContent());
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = ex.Message }));
            }
        }
Exemple #2
0
        public override async Task <long> ChangeNextState(Claim claim, long newStateSetedByuser)
        {
            if (newStateSetedByuser == (long)ClaimState.eId.Borrador)
            {
                var files = await getFileService.GetByClaimId(claim.Id);

                if (files != null)
                {
                    var reclamo = files.FirstOrDefault(x => x.FileTypeId == (long)FileType.eId.reclamo);

                    if (reclamo != null)
                    {
                        await deleteFileService.Delete(reclamo);
                    }
                }
            }

            if (newStateSetedByuser > 0)
            {
                return(newStateSetedByuser);
            }

            return((long)ClaimState.eId.En_Revision);
        }