public ActionResult ValidarAnularMovimientoCaja(int pMovimientoCajaId) { var operacion = MovimientoCajaBL.Obtener(pMovimientoCajaId).Operacion; if (operacion == "INI") { int pCreditoId = CuentaxCobrarBL.Obtener(x => x.MovimientoCajaId == pMovimientoCajaId).CreditoId.Value; if (PlanPagoBL.Contar(x => x.Estado == "PAG" && x.CreditoId == pCreditoId) > 0) { return(Json(true, JsonRequestBehavior.AllowGet)); } } return(Json(false, JsonRequestBehavior.AllowGet)); }
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)); } } }