public JsonResult RegistroGirls(string mail, string password)
        {
            var respuesta = new RespuestaModel();

            if (girls.GetExisteEmail(mail, true))
            {
                respuesta.Descripcion = "La direccion de e-mail: " + mail + " ya existe en nuestro sistema";
                return(Json(respuesta));
            }

            var identificador = util.NuevoIdentificador();
            var password64    = util.CodeBase64(mail + "#" + password);
            var modelGirl     = util.SetGirlsModel(mail, password64, identificador);

            modelGirl = girls.InsertGirls(modelGirl);

            var enlaze         = util.ConstruirEnlazeRegistro(mail, identificador);
            var estructuraMail = util.SetEstructuraMailRegister(enlaze, mail);

            sendMail.EnviarMailNotificacion(estructuraMail, hostEnv);

            if (modelGirl.Id > 0)
            {
                respuesta.Descripcion = "Registro satisfactorio, fue enviado un email a tu direccion electronica para la activacion de tu cuenta";
            }
            else
            {
                respuesta.Descripcion = "Registro fallido";
            }

            return(Json(respuesta));
        }
示例#2
0
        public JsonResult RegistroAdm(string email, string password)
        {
            var respuesta = new RespuestaModel();

            if (userAdm.GetExisteEmail(email, true))
            {
                respuesta.Descripcion = "La direccion de e-mail: " + email + " ya existe en nuestro sistema";
                return(Json(respuesta));
            }

            var password64 = util.CodeBase64(email + "#" + password);
            var adm        = new UserAdm()
            {
                EmailAdm = email, PasswordAdm = password64,
                Activo   = true, Fecha = DateTime.UtcNow, RolAdm = "administrador"
            };

            adm = userAdm.InsertAdm(adm);

            if (adm.Id > 0)
            {
                respuesta.Descripcion = "Registro satisfactorio";
            }
            else
            {
                respuesta.Descripcion = "Registro fallido";
            }

            return(Json(respuesta));
        }
示例#3
0
        public List <ImagenPortadaModel> GetImagenesGaleria(Guid identidad)//Perfil
        {
            var model = new List <ImagenPortadaModel>();

            model = (from perfil in db.ProfileGirls
                     join galeria in db.GaleriaGirls on perfil.Identidad equals galeria.Identidad
                     where perfil.Identidad == identidad
                     select new { perfil, galeria }).AsEnumerable()
                    .Select(x => new ImagenPortadaModel
            {
                Id          = x.galeria.Id,
                IdGirl      = x.perfil.Id,
                Username    = x.perfil.Username,
                Identidad   = x.perfil.Identidad.ToString(),
                Texto       = string.IsNullOrEmpty(x.galeria.Texto) ? x.perfil.Presentacion : x.galeria.Texto,
                Img64       = "data:image/jpeg;base64," + x.galeria.Img64,
                PathImagen  = "assets/Girls/Photo/" + x.galeria.PathImagen,
                UrlProfile  = EngineData.UrlServerHost + "cl?user="******"&ide=" + util.CodeBase64(x.perfil.Identidad.ToString()),
                Fecha       = x.galeria.Fecha,
                UrlEliminar = EngineData.UrlServerHost + "api/DeleteImageGirl?username="******"&id=" + x.galeria.Id,
                IconLike    = EngineData.IconLike,
                IconNotLike = EngineData.IconNotLike,
                Usershow    = x.perfil.Username.Split("-")
            }).OrderByDescending(x => x.Fecha).ToList();

            return(model);
        }
示例#4
0
        public string GetProfileImage(string username)
        {
            var src = db.ProfileGirls.Where(x => x.Username == username).OrderByDescending(x => x.Fecha).Select(x => x.Img64).FirstOrDefault();

            if (string.IsNullOrEmpty(src))
            {
                src = "data:image/jpeg;base64," + util.CodeBase64("assets/ImagesSite/unphoto.jpg", false);
            }
            else
            {
                src = "data:image/jpeg;base64," + src;
            }

            return(src);
        }
示例#5
0
        public GirlProfileModel GetUsuario(string username, bool activo)
        {
            var model = (from girl in db.Girls
                         join profile in db.ProfileGirls on girl.Identidad equals profile.Identidad
                         where girl.Activo == activo && profile.Username.ToUpper() == username.ToUpper()
                         select new { girl, profile }).AsEnumerable()
                        .Select(x => new GirlProfileModel
            {
                Id          = x.girl.Id,
                Identidad   = x.girl.Identidad.ToString(),
                Identidad64 = util.CodeBase64(x.girl.Identidad.ToString()),
                Username    = x.profile.Username
            }).FirstOrDefault();

            return(model);
        }
        public RedirectResult GirlPageUrl(string id)  // id = username
        {
            if (string.IsNullOrEmpty(id))
            {
                return(RedirectPermanent(EngineData.UrlServerHost));
            }

            var girl = girls.GetGirls(id);

            if (girl == null)
            {
                return(RedirectPermanent(EngineData.UrlServerHost));
            }
            else
            {
                return(RedirectPermanent(EngineData.UrlServerHost + "cl?user="******"&ide=" + util.CodeBase64(girl.Identidad)));
            }
        }