public async Task <IActionResult> GetClientLogo(string cliId, string secretKey)
        {
            try
            {
                var categories = await _clientManager.GetClientDataByClientId(cliId, secretKey);

                if (categories == null)
                {
                    return(Ok(new
                    {
                        logoLink = "N/A",
                        isValid = false
                    }));
                }
                return(Ok(new
                {
                    logoLink = categories.CliLogoPath,
                    isValid = true
                }));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get Client");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> InsertRisorse([FromBody] RisorseDto risorseDto)
        {
            try
            {
                // Retreiving the newly created richieste object from bll.
                var categories = await _risorseManager.InsertAsync(User, risorseDto);

                // Null Exception handling code block
                if (categories == null)
                {
                    return(NotFound());
                }
                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "add", "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 new Risorse");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <ActionResult> FindSediAziendeBySedeId(int sedeId)
        {
            try
            {
                var sediAziende = await _sediAziendeManager.FindBySedeIdAsync(sedeId);

                if (sediAziende == null)
                {
                    return(NotFound());
                }
                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "get", "Sedi Aziende");
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #4
0
        public IActionResult TestEmail([FromBody] EmailDto emailDto)
        {
            try
            {
                // Retrieving the dto object that contain the mail address and mail body
                // which is required to send the mail to the specific risorse.

                // Initiating the recipient email address
                _emailManager.To.Add(emailDto.To);
                // Initiating the recipient email address
                _emailManager.Cc.Add(emailDto.CC);
                // Initiating the sender email address
                _emailManager.From = emailDto.From;
                // Initiating the mail subject
                _emailManager.Subject = emailDto.Sub;
                // Initiating the mail body
                _emailManager.Body = emailDto.Body;
                // Sending the mail to the specific recipient
                var status = _emailManager.Send();
                //// creating the azioni object passing the related details and description.
                //var azioniDto = _talentBLLWrapper.UtilityBll.GetAzioniDtoObject(User, "email", "send hard skill invitation");
                //// logging the activity record by the user.
                //_talentBLLWrapper.AzuiniBll.AzioniInsert(azioniDto);
                return(Ok(new { status = status }));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = _utilityManager.ReturnErrorObj(x, User, "Send Hard skill invitation");
                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> LoginClients()
        {
            try
            {
                var log = await _clientManager.GetAllClientDataAsync();

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #6
0
        public async Task <IActionResult> GetAllMenu(SupportedLanguage language)
        {
            try
            {
                // Retreiving data from the system by provided language.
                var categories = await _multiLanguageManager.GetAllMenuAsync(language);

                if (categories == null)
                {
                    return(NotFound());
                }
                return(Ok(categories));
            }
            catch (Exception x)
            {
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get All Menu");

                return(BadRequest(errorObj));
            }
        }
Exemple #7
0
        public async Task <IActionResult> LogOperations()
        {
            try
            {
                var logOperazionis = await _operazioniManager.GetAllLogOperazioniData();

                if (logOperazionis == null)
                {
                    return(NotFound());
                }
                return(Ok(logOperazionis));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get Log Operazioni");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> GetMailModelObj(string langName)
        {
            try
            {
                // retrieving the list of data by passing the ris_id
                var categories = await _hardSkillManager.GetMailModelAsync(User, langName);

                if (categories == null)
                {
                    return(NotFound());
                }
                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "get", "mail model data");
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #9
0
        public async Task <IActionResult> GetFindByAllContattiByContAzSedeId(int contAzSedeId)
        {
            try
            {
                var data = await _contattiManager.GetFindByAllContattiByContAzSedeIdAsync(User, contAzSedeId);

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

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

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #10
0
        public async Task <IActionResult> GetSchedule(int risId, string langName)
        {
            try
            {
                // passing the ridId and language name to business logic layer to retreive the list data.
                var categories = await _softSkillManager.GetSavedWsResultByRisIdAsync(risId, langName);

                // Null Reference handling.
                if (categories == null)
                {
                    return(NotFound());
                }

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

                return(Ok(categories));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get saved web service result.");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> LaunchSpItpFindResource(
            string name    = null,
            string surname = null, string email          = null,
            string phone   = null, string date_of_birth  = null,
            string cities  = null, string keyword_skill1 = null,
            string cli_id  = null, string indebug        = null
            )
        {
            //return Ok();
            try
            {
                var categories = await _robotManager.LaunchSpItpFindResourceDataAsync
                                 (
                    cli_id, name, surname,
                    email, phone, date_of_birth,
                    cities, keyword_skill1, indebug
                                 );

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

                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "get", "launch SP [Sp_schedulazione_residuo_cv] ");
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

                return(Ok(categories));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "launch SP [Sp_Itp_Find_Resource] ");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> GetAllAzioniType(SupportedLanguage language)
        {
            try
            {
                //var categories = await _azioniManager.GetAllTipiAzione();
                var categories = await _differentListManager.GetAllAzioniTypeDescriptionAsync(language);

                if (categories == null)
                {
                    return(NotFound());
                }
                return(Ok(categories));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get Last Login Info Azioni");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #13
0
        public async Task <IActionResult> GetOptimizedAziendeClientiFinaleByAzId(int azId)
        {
            try
            {
                // retrieving the list of data by passing the az_id
                var categories = await _clientFinaleManager.GetFindAllByOptimizedAziendeClienteFinale(User, azId);

                if (categories == null)
                {
                    // Returning 404 error for null.
                    return(NotFound());
                }
                // Retrurning success code along with the retrieved data.
                return(Ok(categories));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get all aziende_client_finale");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> FindBySiglaRichiestaData(int azid, string azCliId, string azSiglaRichiesta)
        {
            try
            {
                var aziendes = await _aziendeManager.FindBySiglaRichiestaData(azid, azCliId, azSiglaRichiesta);

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #15
0
        public async Task <IActionResult> GetLastAnalysisInfo(string cliId, string uteId)
        {
            try
            {
                var terminiDtos = await _terminiManager.GetLastAnalysisInfoData(cliId, uteId);

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

                return(Ok(terminiDtos));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get all termini by sinonimo");

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> CountMasterFilterUtentiByFilterId(int filterId)
        {
            try
            {
                // passing the filter id to retrieve the number of record found for that filter.
                var data = await _globalGridManager.CountMasterFilterUtentiByFilterIdAsync(filterId);


                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "get", "Count Master Filter User Info By Filter" + "");
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

                return(Ok(data));
            }
            catch (Exception x)
            {
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Count Master Filter User Info By Filter");

                if (x.Message == "Token Expired")
                {
                    return(Unauthorized());
                }
                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> ManageUpdateRole([FromBody] ViewRuoloUtentiDto viewRuoloUtentiDto)
        {
            try
            {
                var categories = await _roleManager.ManageUpdateRoleData(viewRuoloUtentiDto);

                if (categories == null)
                {
                    return(NotFound());
                }
                return(Ok(viewRuoloUtentiDto));
            }
            catch (Exception x)
            {
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Update Role Data");

                return(BadRequest(errorObj));
            }
        }
        public async Task <IActionResult> GetStatiRichListRisDescr(string langName)
        {
            try
            {
                var data = await _richiesteManager.GetStatiRichListRisDescrAsync(langName);

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

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

                // Returning the error object.
                return(BadRequest(errorObj));
            }
        }
Exemple #19
0
        public async Task <IActionResult> GetUserProfileDataByUteId(string uteId, string cliId)
        {
            try
            {
                //var categories = await _talentBllWrapper.UtentiBll.FindUserProfileData(uteId, cliId);
                var categories = await _userManager.FindUserProfileData(uteId, cliId);

                if (categories == null)
                {
                    return(NotFound());
                }
                return(Ok(categories));
            }
            catch (Exception x)
            {
                // Code block of Exception handling and logging into log_operazione table.
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "Get all Fillali");

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