예제 #1
0
        public async Task <IActionResult> InsertTalentRichlistRisorse(RichiesteListaRisorseDto richiesteListaRisorseDto)
        {
            try
            {
                if (richiesteListaRisorseDto == null)
                {
                    return(NotFound());
                }

                await _richiesteManager.InsertTalentRichlistRisorseAsync(richiesteListaRisorseDto, User);

                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "add", "talent_richieste_lista_risorse");
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

                return(Ok());
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Insert Talent_Richlist_Risorse");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }