public ActionResult Delete(CobroAlquilerModel collection) { try { var bCobro = false; var cobbll = new CobrosBLL(); collection.Pago = cobbll.GetById(collection.Pago.PagoId.ToString()); bCobro = cobbll.Delete(collection.Pago); if (bCobro) { ViewBag.TipoMsj = "Success"; ViewBag.Message = "La anulación de cobro se realizó con exito. !!!"; return(View()); } else { ViewBag.TipoMsj = "Info"; ViewBag.Message = "No pudo realizar la anulación"; return(View(collection)); } } catch (Exception ex) { ViewBag.TipoMsj = "Error"; ViewBag.Message = ex.Message; return(View(collection)); } }