public async Task <ActionResult> Edit([Bind(Include = "TipoBienID,TipoBienDescripcion")] TipoBien tipobien) { if (ModelState.IsValid) { db.Entry(tipobien).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tipobien)); }
public async Task <ActionResult> Create([Bind(Include = "TipoBienID,TipoBienDescripcion")] TipoBien tipobien) { if (ModelState.IsValid) { db.TipoBiens.Add(tipobien); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tipobien)); }
public void Update(TipoBienDTO entity) { try { TipoBien tipoBien = Mapper.Map <TipoBien>(entity); tipoBienService.Update(tipoBien); } catch (Exception ex) { throw ex; } }
// GET: /TipoBien/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TipoBien tipobien = await db.TipoBiens.FindAsync(id); if (tipobien == null) { return(HttpNotFound()); } return(View(tipobien)); }