public ActionResult Edit(int id) { UserPosterClient userPosterClient = new UserPosterClient(); UserPoster c = new UserPoster(); c = userPosterClient.Get(id); return(View("Edit", c)); }
public ActionResult Postularme(int id, int ciudadId, int paisId, int trabajoId, int categoriaId, string pais, string ciudad, string posicion, string tipoTrabajo, string descripcion, string calle, int idPoster, string dUrl) { UserPosterClient poster = new UserPosterClient(); var elementoPoster = poster.Get(idPoster); Post post = new Post(); post.NombreCiudad = ciudadId; post.NombrePais = paisId; post.NombreTipoTrabajo = trabajoId; post.NombreCategoria = categoriaId; ViewBag.Empresa = elementoPoster.NombreEmpresa; post.Paises = pais; post.Ciudades = ciudad; post.TipoTrabajos = tipoTrabajo; post.Descripcion = descripcion; post.Id = id; ViewBag.Correo = elementoPoster.Email; post.NombrePosicion = posicion; ViewBag.Foto = GetImagePost(id); post.NombreCalle = calle; post.DireccionUrl = dUrl; post.Poster = idPoster; return(View(post)); }
public ActionResult EditarPoster(UserPoster c) { UserPosterClient posterClient = new UserPosterClient(); var elemento = posterClient.Get(c.Id); if (ModelState.IsValid) { c.Email = c.Email.ToLower(); c.ConfirmarEmail = c.ConfirmarEmail.ToLower(); if (c.Email == c.ConfirmarEmail) { if (elemento.Contra == c.Contra) { if (c.NombreCiudad == 0 || c.NombrePais == 0) { return(EditarPoster("Debes seleccionar un pais y su ciudad correspondiente.")); } else { if (elemento.Email == c.Email) { posterClient.Update(c); if (User.IsInRole("Poster")) { return(RedirectToAction("Logout")); } else { return(RedirectToAction("GestionUserPoster", "UserAdmin")); } } else { if (posterClient.FindCorreo(c)) { return(EditarPoster("Ya existe una cuenta registrada con ese correo")); } else { posterClient.Update(c); if (User.IsInRole("Poster")) { return(RedirectToAction("Logout")); } else { return(RedirectToAction("GestionUserPoster", "UserAdmin")); } } } } } else { return(EditarPoster("Las Contraseñas no coinciden")); } } else { return(EditarPoster("Los Emails no coinciden")); } } else { return(View(c)); } }