public WhoreModel(W***e entity) { Entity = entity; Id = entity.Id; FirstName = entity.FirstName; LastName = entity.LastName; Age = entity.Age; PricePerHour = entity.PricePerHour; Pimp = entity.Pimp; }
public ActionResult Create(W***e w***e) { try { // INSERTADO METODO ADD A NUESTRO CONTROLADOR if (ModelState.IsValid) { db.W****s.Add(w***e); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(w***e)); } catch { return(View(w***e)); } }
public ActionResult Edit(int id, W***e w***e) { try { //TODO CODIGO PARA EDITAR if (ModelState.IsValid) { db.Entry(w***e).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(w***e)); } catch { return(View(w***e)); } }
public ActionResult Delete(int id, W***e w***e) { try { // TODO: Add delete logic here if (ModelState.IsValid) { w***e = db.W****s.Find(id); if (w***e == null) { return(HttpNotFound()); } db.W****s.Remove(w***e); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(w***e)); } catch { return(View(w***e)); } }