public ActionResult DeleteConfirmed(int id) { var p = new ClienteApiProcess(); Cliente cliente = p.ReadBy(id); p.Delete(cliente); return(RedirectToAction("Index")); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var p = new ClienteApiProcess(); Cliente cliente = p.ReadBy(id.Value); if (cliente == null) { return(HttpNotFound()); } return(View(cliente)); }
public ActionResult AgregarMascota(int id) { var obj = new Paciente(); var db = new ClienteApiProcess(); var dueño = db.ReadBy(id); obj.Cliente = dueño; obj.ClienteId = dueño.Id; EspecieApiProcess eap = new EspecieApiProcess(); var especies = eap.ToList(); var listEspecies = new SelectList(especies, "Id", "Nombre"); ViewData["Especies"] = listEspecies; return(View(obj)); }