public async Task <ActionResult> DeleteConfirmed(int id) { tipoExpediente tipoExpediente = await db.tipoExpediente.FindAsync(id); db.tipoExpediente.Remove(tipoExpediente); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id,tipo")] tipoExpediente tipoExpediente) { if (ModelState.IsValid) { db.Entry(tipoExpediente).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tipoExpediente)); }
public async Task <ActionResult> Create([Bind(Include = "id,tipo")] tipoExpediente tipoExpediente) { if (ModelState.IsValid) { db.tipoExpediente.Add(tipoExpediente); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tipoExpediente)); }
// GET: tipoExpedientes/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tipoExpediente tipoExpediente = await db.tipoExpediente.FindAsync(id); if (tipoExpediente == null) { return(HttpNotFound()); } return(View(tipoExpediente)); }