public async Task <JsonResult> CreateCandidateSkills(CategoriasCandidatosDTO category)
        {
            Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();

            try
            {
                category.Categorias = null;
                category.HabilidadesCandidatos.ToList().ForEach(c => { c.Habilidades = null; c.Consecutivo = 0; c.CodigoCategoriaCandidato = 0; });
                CategoriasServices categoryService = new CategoriasServices();
                if (category.Consecutivo != 0)
                {
                    result.obj = await categoryService.ModificarCategoriaCandidato(category);
                }
                else
                {
                    result.obj = await categoryService.CrearCategoriaCandidatos(category);
                }
                if (result.obj == null)
                {
                    return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
 public PublicacionPageModel()
 {
     _candidatoService      = new CandidatosServices();
     _gruposService         = new GruposServices();
     _archivosService       = new ArchivosServices();
     _administracionService = new AdministracionServices();
     _categoriasService     = new CategoriasServices();
     _dateTimeHelper        = FreshIOC.Container.Resolve <IDateTimeHelper>();
 }
        public async Task <JsonResult> DeleteAgentSkills(CategoriasRepresentantesDTO category)
        {
            Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();

            try
            {
                CategoriasServices categoryService = new CategoriasServices();
                result.obj = await categoryService.EliminarCategoriaRepresentante(category);

                if (result.obj == null)
                {
                    return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #4
0
        public async Task CategoriasServices_CrearCategoriaCandidatos_ShouldCreate()
        {
            CategoriasServices categoriaService = new CategoriasServices();

            CategoriasCandidatosDTO categoriaCandidato = new CategoriasCandidatosDTO
            {
                CodigoCandidato       = 5,
                CodigoCategoria       = 3,
                HabilidadesCandidatos = new List <HabilidadesCandidatosDTO>
                {
                    new HabilidadesCandidatosDTO {
                        CodigoHabilidad = 2, NumeroEstrellas = 3
                    }
                }
            };

            WrapperSimpleTypesDTO wrapper = await categoriaService.CrearCategoriaCandidatos(categoriaCandidato);

            Assert.IsNotNull(wrapper);
            Assert.IsTrue(wrapper.Exitoso);
        }
        public async Task <JsonResult> CreateGroupSkills(CategoriasGruposDTO category)
        {
            Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();

            try
            {
                category.Categorias = null;
                category.Grupos     = null;
                CategoriasServices categoryService = new CategoriasServices();
                result.obj = await categoryService.CrearCategoriaGrupos(category);

                if (result.obj == null)
                {
                    return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
 public BuscadorPageModel()
 {
     _categoriaService = new CategoriasServices();
 }
 public CategoriaPageModel()
 {
     _categoriaService   = new CategoriasServices();
     _habilidadesService = new HabilidadesServices();
 }