public ActionResult ObservarCredito(int pCreditoId, string pObs) { var c = CreditoBL.Obtener(pCreditoId); c.Observacion = pObs; CreditoBL.Actualizar(c); return(Json(true)); //using (var scope = new TransactionScope()) //{ // try // { // CreditoBL.ActualizarParcial(new Credito { CreditoId = pCreditoId, Observacion = pObs }, x => x.Observacion); // scope.Complete(); // return Json(true); // } // catch (Exception ex) // { // scope.Dispose(); // return Json(ex.InnerException.Message); // } //} }
public ActionResult CondonarCredito(int pCreditoId, decimal pMontocxc, string pObs) { using (var scope = new TransactionScope()) { try { var cxc = CuentaxCobrarBL.Obtener(x => x.CreditoId == pCreditoId); if (cxc == null) { CuentaxCobrarBL.Crear(new CuentaxCobrar { Operacion = "CDN", Monto = pMontocxc, Estado = "PEN", CreditoId = pCreditoId }); } else { cxc.CreditoId = pCreditoId; cxc.Operacion = "CDN"; cxc.Monto = pMontocxc; cxc.Estado = "PEN"; CuentaxCobrarBL.Actualizar(cxc); } var c = CreditoBL.Obtener(pCreditoId); c.Observacion = VendixGlobal.GetFecha().ToString() + " " + pObs; CreditoBL.Actualizar(c); scope.Complete(); return(Json(true)); } catch (Exception ex) { scope.Dispose(); return(Json(ex.InnerException.Message)); } } }