public ActionResult ConsultaGestionesPendientes()
        {
            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            ManagerGestionCartera manage = new ManagerGestionCartera();

            var ret = manage.ConsultaGestionesPendientes();

            return(Json(ret));
        }
        //public ActionResult HistoricoPlanPagos(GestionPlanPlagos plan)
        //{
        //    if (plan.IdCredito == null) return View();

        //    ManagerGestionCartera manage = new ManagerGestionCartera();

        //    if (Session["agente"] == null)
        //        return RedirectToAction("LogOff", "Login");

        //    var ret = manage.ConsultaPlanPagos(plan);

        //    return Json(ret);
        //}
        public ActionResult conultar_Datos_creditos(GestionCuenta cuenta)
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.consultaInformacionCuenta(cuenta);

            return(Json(ret));
        }
        public ActionResult mostrar_imagenes(GestionSolicitudes solicitudes)
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.MostrarImagenesCreddid(solicitudes);

            return(Json(ret));
        }
        public ActionResult comboTipo()
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.monstrarAciones();

            return(Json(ret));
        }
        public ActionResult EjecutarAccionCredito(GestionAccion gestion)
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            gestion.Usuario = Session["agente"].ToString();
            var dto_ret = manage.EjecutarAccion(gestion);

            return(Json(dto_ret.FirstOrDefault()));
        }
        public ActionResult BuscarClienteNombre(GestionBucket bucketCobros)
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            bucketCobros.cod_agente = Session["agente"].ToString();
            var dto_ret = manage.BusquedaNombre(bucketCobros);

            return(Json(dto_ret));
        }
        public ActionResult RechazarGestion(GestionCartera gestion)
        {
            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            ManagerGestionCartera manage = new ManagerGestionCartera();

            gestion.UsuarioAprobacion = Session["agente"].ToString();

            var ret = manage.RechazarGestion(gestion);

            return(Json(ret.FirstOrDefault()));
        }
        public ActionResult ContactosDireccion(GestionContacto contacto)
        {
            if (contacto.Identificacion == null)
            {
                return(View());
            }
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }
            var ret = manage.ConsultarDirecciones(contacto);

            return(Json(ret));
        }
        public ActionResult consultarGridCreditos(GestionCuenta cuenta)
        {
            if (cuenta.IdCredito == null)
            {
                return(View());
            }
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.consultaCritoCredito(cuenta);

            return(Json(ret));
        }
        public ActionResult calculaCuota(GestionCartera mora)
        {
            if (mora.IdCredito == null || mora.Fecha == null)
            {
                return(View());
            }
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.calculaCuota(mora);

            return(Json(ret));
        }
        public ActionResult consultarPrestamosParientes(GestionPersona personas)
        {
            if (personas.Identificacion == null)
            {
                return(View());
            }
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.consultaCreditoParientes(personas);

            return(Json(ret));
        }
        public ActionResult consultarPrestamosCliente(GestionPrestamo prestamos)
        {
            if (prestamos.Identificacion == null)
            {
                return(View());
            }
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.consultaPrestamosCliente(prestamos);

            return(Json(ret));
        }
        public ActionResult HistoricoPagos(GestionCartera gestion)
        {
            if (gestion.IdCredito == null)
            {
                return(View());
            }

            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.ConsultaPagos(gestion);

            return(Json(ret));
        }
        public ActionResult BuscarCliente(GestionBucket bucketCobros)
        {
            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }
            if ((bucketCobros.Identificacion.Length != 9 && bucketCobros.Identificacion.Length != 12))
            {
                bucketCobros.IdCredito      = int.Parse(bucketCobros.Identificacion);
                bucketCobros.Identificacion = null;
                bucketCobros.Nombre         = "";
            }
            var dto_ret = manage.ObtenerEncabezado(bucketCobros);

            return(Json(dto_ret));
        }
        public ActionResult CorreoPersona(GestionPersona personas)

        {
            if (personas.Identificacion == null)
            {
                return(View());
            }

            ManagerGestionCartera manage = new ManagerGestionCartera();

            if (Session["agente"] == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }

            var ret = manage.correosPersona(personas);

            return(Json(ret));
        }