Ejemplo n.º 1
0
        public ProfileGirls InsertProfileGirls(ProfileGirls model)
        {
            db.ProfileGirls.Add(model);
            db.SaveChanges();

            return(model);
        }
Ejemplo n.º 2
0
        public ProfileGirls SetProfileGirls(string nombre, string apellido, string dni, string telefono, string path, Guid identidad, string username, string img64,
                                            DateTime fechaNacimiento, string sexo, string presentacion, string descripcion, string escort,
                                            decimal valor1, decimal valor2, string drink, string smoke, decimal estatura, decimal peso,
                                            string medidas, string contextura, string piel, string hair, string eyes, string country, string location, string sector, string depilacion, string nacionalidad)
        {
            var profileGirls = new ProfileGirls()
            {
                Identidad       = identidad,
                Nombre          = nombre,
                Apellido        = apellido,
                Dni             = dni,
                Telefono        = telefono,
                Path            = path,
                Fecha           = DateTime.UtcNow,
                Username        = username,
                Img64           = string.IsNullOrEmpty(path)?string.Empty:img64,
                FechaNacimiento = fechaNacimiento,
                Sexo            = sexo,
                Presentacion    = presentacion,
                Descripcion     = descripcion,
                CategoriaEscort = escort,
                ValorHora       = valor1,
                ValorMediaHora  = valor2,
                Drink           = drink,
                Smoke           = smoke,
                Estatura        = estatura,
                Peso            = peso,
                Medidas         = medidas,
                Contextura      = contextura,
                Piel            = piel,
                Hair            = hair,
                Eyes            = eyes,
                Country         = country,
                Location        = location,
                Sector          = sector,
                Depilacion      = depilacion,
                Nacionalidad    = nacionalidad,
            };

            return(profileGirls);
        }
        public JsonResult GetProfileGirl(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(Json(null));
            }

            var identidad = Guid.Parse(id);

            var profile = new ProfileGirls();

            profile = profileGirls.GetProfileGirls(identidad);

            if (profile != null)
            {
                profile.StrFechaNacimiento = util.StrFecha(profile.FechaNacimiento);
                profile.Edad = util.CalcularEdad(profile.FechaNacimiento);
            }

            return(Json(profile));
        }
Ejemplo n.º 4
0
        public ProfileGirls UpdateProfileGirls(ProfileGirls model)
        {
            var profile = db.ProfileGirls.Where(x => x.Identidad == model.Identidad).FirstOrDefault();

            db.ProfileGirls.Attach(profile);
            profile.Nombre          = !string.IsNullOrEmpty(model.Nombre) ? model.Nombre : profile.Nombre;
            profile.Apellido        = !string.IsNullOrEmpty(model.Apellido) ? model.Apellido :profile.Apellido;
            profile.FechaNacimiento = !string.IsNullOrEmpty(model.FechaNacimiento.ToString()) ? model.FechaNacimiento : profile.FechaNacimiento;
            profile.Dni             = !string.IsNullOrEmpty(model.Dni) ? model.Dni : profile.Dni;
            profile.Telefono        = !string.IsNullOrEmpty(model.Telefono) ? model.Telefono : profile.Telefono;
            profile.Sexo            = !string.IsNullOrEmpty(model.Sexo) ? model.Sexo : profile.Sexo;
            profile.Username        = !string.IsNullOrEmpty(model.Username) ? model.Username : profile.Username;
            profile.Presentacion    = !string.IsNullOrEmpty(model.Presentacion) ? model.Presentacion : profile.Presentacion;
            profile.Descripcion     = !string.IsNullOrEmpty(model.Descripcion) ? model.Descripcion : profile.Descripcion;
            profile.Path            = !string.IsNullOrEmpty(model.Path) ? model.Path : profile.Path;
            profile.Img64           = !string.IsNullOrEmpty(model.Img64) ? model.Img64 : profile.Img64;
            profile.ValorHora       = model.ValorHora > 0 ? model.ValorHora : profile.ValorHora;
            profile.ValorMediaHora  = model.ValorMediaHora > 0? model.ValorMediaHora : profile.ValorMediaHora;
            profile.Estatura        = model.Estatura > 0 ? model.Estatura : profile.Estatura;
            profile.Peso            = model.Peso > 0 ? model.Peso : profile.Peso;
            profile.Medidas         = !string.IsNullOrEmpty(model.Medidas) ? model.Medidas : profile.Medidas;
            profile.Contextura      = !string.IsNullOrEmpty(model.Contextura) ? model.Contextura : profile.Contextura;
            profile.Piel            = !string.IsNullOrEmpty(model.Piel) ? model.Piel : profile.Piel;
            profile.Hair            = !string.IsNullOrEmpty(model.Hair) ? model.Hair : profile.Hair;
            profile.Eyes            = !string.IsNullOrEmpty(model.Eyes) ? model.Eyes : profile.Eyes;
            profile.Depilacion      = !string.IsNullOrEmpty(model.Depilacion) ? model.Depilacion : profile.Depilacion;
            profile.Drink           = !string.IsNullOrEmpty(model.Drink) ? model.Drink : profile.Drink;
            profile.Smoke           = !string.IsNullOrEmpty(model.Smoke) ? model.Smoke : profile.Smoke;
            profile.Country         = !string.IsNullOrEmpty(model.Country) ? model.Country : profile.Country;
            profile.Location        = !string.IsNullOrEmpty(model.Location) ? model.Location : profile.Location;
            profile.Nacionalidad    = !string.IsNullOrEmpty(model.Nacionalidad) ? model.Nacionalidad : profile.Nacionalidad;
            profile.Sector          = !string.IsNullOrEmpty(model.Sector) ? model.Sector : profile.Sector;
            db.SaveChanges();

            return(profile);
        }