// GET: plastico/Delete/5 public ActionResult Details(int id) { PlasticoBLL oBLL = new PlasticoBLL(); plastico tarjeta = oBLL.Retrieve(id); return(View(tarjeta)); }
public plastico Retrieve(int id) { plastico Result = null; using (var r = new Repository <plastico>()) { Result = r.Retrieve(p => p.id_tarjeta == id); } return(Result); }
public plastico Create(plastico tarjeta) { plastico Result = null; using (var r = new Repository <plastico>()) { plastico tmp = r.Retrieve( p => p.numero_tarjeta == tarjeta.numero_tarjeta); if (tmp == null) { Result = r.Create(tarjeta); } else { throw (new Exception()); } } return(Result); }
public bool Edit(plastico tarjeta) { bool Result = false; using (var r = new Repository <plastico>()) { plastico tmp = r.Retrieve( p => p.numero_tarjeta == tarjeta.numero_tarjeta && p.id_tarjeta != tarjeta.id_tarjeta); if (tmp == null) { Result = r.Update(tarjeta); } else { throw (new Exception()); } } return(Result); }
public ActionResult Edit(plastico tarjeta) { ActionResult Result; try { if (ModelState.IsValid) { PlasticoBLL oBLL = new PlasticoBLL(); oBLL.Edit(tarjeta); Result = RedirectToAction("Index"); } else { Result = View(tarjeta); } return(Result); } catch (Exception e) { return(View(tarjeta)); } }