Пример #1
0
        public async Task <JsonResult> listarEvents(BuscadorDTO filter)
        {
            try
            {
                if (!await ValidateIfOperationIsSupportedByPlan(Util.Portable.Enums.TipoOperacion.ConsultaEventos))
                {
                    return(Json(Helper.returnErrorUnauthorizedByPlan(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }

                Result <GruposEventosDTO> result       = new Result <GruposEventosDTO>();
                GruposServices            groupService = new GruposServices();
                filter.CodigoIdiomaUsuarioBase = UserLoggedIn().PersonaDelUsuario.CodigoIdioma;
                result.list = await groupService.ListarEventos(filter);

                if (result.list != null)
                {
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public async Task GruposServices_ListarEventos_ShouldSearch()
        {
            GruposServices gruposServices = new GruposServices();

            BuscadorDTO buscadorDTO = new BuscadorDTO
            {
                CategoriasParaBuscar = new List <int>
                {
                    3
                },
                EstaturaInicial         = 0,
                EstaturaFinal           = 0,
                PesoInicial             = 0,
                PesoFinal               = 0,
                SkipIndexBase           = 0,
                TakeIndexBase           = 5,
                IdiomaBase              = Idioma.Español,
                IdentificadorParaBuscar = null,
                FechaInicio             = new DateTime(1950, 1, 1),
                FechaFinal              = new DateTime(2050, 1, 1)
            };

            List <GruposEventosDTO> grupoEventoBuscado = await gruposServices.ListarEventos(buscadorDTO);

            Assert.IsNotNull(grupoEventoBuscado);
        }
Пример #3
0
        public async Task <JsonResult> ValidateIfIWillAttend(GruposEventosAsistentesDTO eventGroup)
        {
            try
            {
                if (eventGroup.CodigoPersona == UserLoggedIn().PersonaDelUsuario.Consecutivo)
                {
                    return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }

                Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();
                GruposServices groupService           = new GruposServices();
                eventGroup.CodigoPersona = UserLoggedIn().PersonaDelUsuario.Consecutivo;
                result.obj = await groupService.BuscarSiPersonaAsisteAGrupoEvento(eventGroup);

                if (result.obj != null)
                {
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #4
0
        public async Task <JsonResult> CreateEvent(GruposEventosDTO post)
        {
            Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();

            try
            {
                GruposServices categoryService = new GruposServices();
                post.CodigoGrupo  = UserLoggedIn().PersonaDelUsuario.GrupoDeLaPersona.Consecutivo;
                post.CodigoIdioma = UserLoggedIn().PersonaDelUsuario.CodigoIdioma;
                if (post.Consecutivo != 0)
                {
                    result.obj = await categoryService.ModificarInformacionGrupoEvento(post);
                }
                else
                {
                    result.obj = await categoryService.CrearGrupoEvento(post);
                }

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

                return(Json(Helper.returnSuccessObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #5
0
 public PerfilPageModel()
 {
     _archivoServices    = new ArchivosServices();
     _personaServices    = new PersonasServices();
     _candidatosServices = new CandidatosServices();
     _gruposServices     = new GruposServices();
     _chatServices       = new ChatsServices();
     _dateTimeHelper     = FreshIOC.Container.Resolve <IDateTimeHelper>();
 }
Пример #6
0
 public PublicacionPageModel()
 {
     _candidatoService      = new CandidatosServices();
     _gruposService         = new GruposServices();
     _archivosService       = new ArchivosServices();
     _administracionService = new AdministracionServices();
     _categoriasService     = new CategoriasServices();
     _dateTimeHelper        = FreshIOC.Container.Resolve <IDateTimeHelper>();
 }
 public BuscadorPerfilesPageModel()
 {
     _candidatoServices      = new CandidatosServices();
     _gruposServices         = new GruposServices();
     _administracionServices = new AdministracionServices();
     _dateTimeHelper         = FreshIOC.Container.Resolve <IDateTimeHelper>();
     _minimaAltura           = 130;
     _minimoPeso             = 20;
     _maximaAltura           = 220;
     _maximoPeso             = 120;
     _maximaEdad             = 80;
 }
Пример #8
0
        public async Task GruposServices_CrearGruposEventosAsistentes_ShouldCreate()
        {
            GruposServices gruposBusiness = new GruposServices();

            GruposEventosAsistentesDTO grupoEvento = new GruposEventosAsistentesDTO
            {
                CodigoEvento  = 13,
                CodigoPersona = 7
            };

            WrapperSimpleTypesDTO wrapper = await gruposBusiness.CrearGruposEventosAsistentes(grupoEvento);

            Assert.IsNotNull(wrapper);
            Assert.IsTrue(wrapper.Exitoso);
        }
Пример #9
0
        async Task <WrapperSimpleTypesDTO> CrearGrupo()
        {
            GruposDTO grupoParaCrear = Persona.GrupoDeLaPersona;

            grupoParaCrear.Personas = Persona;

            GruposServices gruposServices = new GruposServices();

            if (IsNotConnected)
            {
                return(null);
            }
            WrapperSimpleTypesDTO wrapper = await gruposServices.CrearGrupo(grupoParaCrear);

            return(wrapper);
        }
        public async Task <JsonResult> GetListPostsByGroup(BuscadorDTO filter)
        {
            Result <GruposEventosDTO> result = new Result <GruposEventosDTO>();

            try
            {
                GruposServices categoryService = new GruposServices();
                result.list = await categoryService.ListarEventosDeUnGrupo(filter);

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

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #11
0
        public async Task <JsonResult> DeletetEvent(GruposEventosDTO eventGroup)
        {
            try
            {
                Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();
                GruposServices groupService           = new GruposServices();
                result.obj = await groupService.EliminarGrupoEvento(eventGroup);

                if (result.obj != null)
                {
                    return(Json(Helper.returnSuccessDeleteObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorDelete(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorDelete(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #12
0
        public async Task <JsonResult> GetEventDetail(GruposEventosDTO eventGroup)
        {
            try
            {
                Result <GruposEventosDTO> result       = new Result <GruposEventosDTO>();
                GruposServices            groupService = new GruposServices();
                result.obj = await groupService.BuscarGrupoEventoPorConsecutivo(eventGroup);

                if (result.obj != null)
                {
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #13
0
        public async Task <JsonResult> GetAllEvents(BuscadorDTO filter)
        {
            try
            {
                filter.CodigoIdiomaUsuarioBase = UserLoggedIn().PersonaDelUsuario.CodigoIdioma;
                Result <GruposEventosDTO> result       = new Result <GruposEventosDTO>();
                GruposServices            groupService = new GruposServices();
                result.list = await groupService.ListarEventos(filter);

                if (result.list != null)
                {
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
Пример #14
0
        public async Task <JsonResult> GetListAssistantEvents(BuscadorDTO filter)
        {
            try
            {
                Result <GruposEventosAsistentesDTO> result = new Result <GruposEventosAsistentesDTO>();
                GruposServices groupService = new GruposServices();
                filter.ConsecutivoPersona = UserLoggedIn().PersonaDelUsuario.Consecutivo;
                filter.IdiomaBase         = UserLoggedIn().PersonaDelUsuario.IdiomaDeLaPersona;
                result.list = await groupService.ListarEventosAsistentesDeUnaPersona(filter);

                if (result.list != null)
                {
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorList(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }
 public ListaAsistentesPageModel()
 {
     _grupoService   = new GruposServices();
     _dateTimeHelper = FreshIOC.Container.Resolve <IDateTimeHelper>();
 }
        public async Task <JsonResult> CreateGroup(GruposDTO group)
        {
            Result <WrapperSimpleTypesDTO> result = new Result <WrapperSimpleTypesDTO>();

            try
            {
                string newEmail = group.Personas.Usuarios.Email;
                group.Personas.CodigoUsuario  = UserLoggedIn().Consecutivo;
                group.Personas.Usuarios       = UserLoggedIn();
                group.Personas.Usuarios.Email = newEmail;

                GruposServices       groupService   = new GruposServices();
                PersonasServices     personService  = new PersonasServices();
                AuthenticateServices usuarioService = new AuthenticateServices();
                if (group.Consecutivo != 0)
                {
                    group.CategoriasGrupos = null;
                    result.obj             = await personService.ModificarPersona(group.Personas); // Update person

                    if (result.obj != null)
                    {
                        result.obj = await groupService.ModificarInformacionGrupo(group); // Update group
                    }
                    if (result.obj != null)
                    {
                        result.obj = await usuarioService.ModificarEmailUsuario(group.Personas.Usuarios); // Update email user
                    }
                    if (result.obj != null)
                    {
                        UserLoggedIn().PersonaDelUsuario.IdiomaDeLaPersona = group.Personas.IdiomaDeLaPersona;
                    }
                }
                else
                {
                    group.CategoriasGrupos.ToList().ForEach(c => c.Categorias = null);
                    result.obj = await groupService.CrearGrupo(group); // Create a new group

                    if (result.obj != null)
                    {
                        AuthenticateServices service        = new AuthenticateServices();
                        UsuariosDTO          userToValidate = UserLoggedIn();
                        userToValidate.Personas       = null;
                        userToValidate.TiposPerfiles  = null;
                        userToValidate.PlanesUsuarios = null;
                        var userAgent = await service.VerificarUsuario(userToValidate);

                        if (userAgent != null)
                        {
                            setUserLogin(userAgent);
                        }
                    }
                }

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

                result.Message = "La información se ha guardado con éxito";
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(Helper.returnErrorSaveObj(UserLoggedIn().PersonaDelUsuario.CodigoIdioma), JsonRequestBehavior.AllowGet));
            }
        }