Example #1
0
        /// <summary>
        /// notificaciones preventivas
        /// </summary>
        /// <returns></returns>
        public ActionResult Notificaciones()
        {
            List <DetalleFase> list = new List <DetalleFase>();
            LPersonaCasas      pl   = new LPersonaCasas();

            list = pl.GetNotiPreventivas(5);
            Session["Notificaciones"] = list;


            var listdif = list.Select(x => x.Codigo).Distinct().ToList();
            List <DetalleFase> distinctPeople = new List <DetalleFase>();

            //list.GroupBy(p => p.CodCliente)
            //.Select(g => g.FirstOrDefault())
            //  .ToList();
            foreach (var j in listdif)
            {
                distinctPeople.Add(list.Where(s => s.Codigo == j).OrderByDescending(r => r.Fecha).FirstOrDefault());
            }


            distinctPeople.ToList().ForEach(emp =>
            {
                emp.CodCliente    = emp.CodCliente + ":" + list.Where(s => s.Codigo == emp.Codigo).Select(p => p.CantidadCouta).FirstOrDefault();
                emp.CantidadCouta = list.Where(x => x.Codigo == emp.Codigo).Count();
            });
            ViewBag.lista = distinctPeople;
            return(View());
        }
Example #2
0
        public ActionResult GetCliente(string nombre = "")
        {
            LPersonaCasas pl   = new LPersonaCasas();
            var           list = pl.Getlotes(nombre);

            return(Json(list));
        }
Example #3
0
        public ActionResult ExportToExcel(int fase)
        {
            var gv = new GridView();
            List <PersonaCasas> list = new List <PersonaCasas>();
            LPersonaCasas       pl   = new LPersonaCasas();

            list          = pl.GetClienteAllMoraNoAsignados(fase);
            gv.DataSource = list;
            gv.DataBind();
            Response.ClearContent();
            Response.Buffer = true;
            Response.AddHeader("content-disposition", "attachment; filename=DemoExcel.xls");
            Response.ContentType = "application/ms-excel";
            Response.Charset     = "";

            StringWriter   objStringWriter   = new StringWriter();
            HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);

            gv.RenderControl(objHtmlTextWriter);
            Response.Output.Write(objStringWriter.ToString());
            Response.Flush();
            Response.End();

            return(View("Fase", list));
        }
Example #4
0
        public ActionResult getCuotas(string id = "")
        {
            LPersonaCasas lp   = new LPersonaCasas();
            var           info = lp.GetClienteXID(id);

            return(PartialView("_VerDatosPersonales", info));
        }
Example #5
0
        /// <summary>
        /// mostrar datos por fase
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult FaseDetalle(int id)
        {
            List <DetalleFase> list = new List <DetalleFase>();
            LPersonaCasas      pl   = new LPersonaCasas();

            list = pl.GetClienteMoraDetalleXFase(id);
            return(Json(list));
        }
Example #6
0
        public ActionResult PersonaAsigndos()
        {
            LPersonaCasas p   = new LPersonaCasas();
            var           itm = Util.Usuario.ID;
            var           lis = p.GetClienteAllMoraXuser(itm);

            return(Json(lis));
        }
Example #7
0
        public ActionResult BuscarFecha(DateTime fecha)
        {
            List <DetalleFase> list = new List <DetalleFase>();
            LPersonaCasas      pl   = new LPersonaCasas();

            //DateTime dt= Convert.ToDateTime(fecha.Trim());
            list = pl.GetNotiPreventivasXFecha(fecha);
            return(Json(list));
        }
Example #8
0
        public ActionResult GetAlertas()
        {
            List <Alertas> list         = new List <Alertas>();
            LPersonaCasas  pl           = new LPersonaCasas();
            DateTime       datetimeFrom = DateTime.Now.Date;
            DateTime       datetimeTo   = datetimeFrom.AddDays(1);

            list = pl.GetAlertas(datetimeFrom, datetimeTo);
            return(Json(list));
        }
Example #9
0
        public ActionResult DetalleCoutaPagada()
        {
            List <DetalleFase> list = new List <DetalleFase>();
            LPersonaCasas      pl   = new LPersonaCasas();

            list = pl.GetClientesAlDia();
            var jsonResult = Json(list, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }
Example #10
0
        public ActionResult Printf(string idclient, int idoperacion = 0)
        {
            ViewBag.fecha = DateTime.Now;
            LPersonaCasas pc  = new LPersonaCasas();
            LOperaciones  op  = new LOperaciones();
            Imprimir      imp = new Imprimir
            {
                cliente   = pc.GetClienteXID(idclient),
                operacion = op.GetOperacion(idoperacion)
            };

            return(View(imp));
        }
Example #11
0
        public ActionResult Imprimir(string idclient, int idoperacion = 0)
        {
            ViewBag.fecha      = DateTime.Now;
            ViewBag.idclient   = idclient;
            ViewBag.idopracion = idoperacion;
            LPersonaCasas pc  = new LPersonaCasas();
            LOperaciones  op  = new LOperaciones();
            Imprimir      imp = new Imprimir
            {
                cliente   = pc.GetClienteXID(idclient),
                operacion = op.GetOperacion(idoperacion)
            };

            return(PartialView("_Imprimir", imp));
        }
Example #12
0
 public ActionResult GetClienteEnMora()
 {
     try
     {
         LPersonaCasas lg    = new LPersonaCasas();
         var           lista = lg.GetClienteAllMoraNoAsignados();
         if (lista != null)
         {
             return(Json(lista));
         }
         return(Json(""));
     }
     catch (System.Exception)
     {
         throw;
     }
 }
Example #13
0
        public ActionResult Getdatos(string id = "")
        {
            List <DetalleFase> lists = new List <DetalleFase>();
            LPersonaCasas      pl    = new LPersonaCasas();

            lists = pl.GetNotiPreventivas(5);
            var           op       = lists.Where(s => s.CodCliente == id).FirstOrDefault();
            var           detalles = lists.Where(p => p.CodCliente == id).ToList();
            MNotificacion n        = new MNotificacion()
            {
                CodCliente = op.CodCliente,
                Nombre     = op.NombreCompleto,
                Telefono   = op.Telefono,
                Detalles   = detalles,
                Tipos      = Util.GetTipos()
            };

            return(Json(n));
        }
Example #14
0
        // GET: Home
        public ActionResult Index()
        {
            LPersonaCasas per     = new LPersonaCasas();
            LPersonasMora lg      = new LPersonasMora();
            DateTime      re      = DateTime.Now;
            string        mes     = re.Month < 10 ? "0" + Convert.ToString(re.Month) : Convert.ToString(re.Month);
            string        year    = Convert.ToString(re.Year);
            string        periodo = mes + "/" + year;

            ViewBag.fase1        = lg.getfase1();
            ViewBag.fase2        = lg.getfase2();
            ViewBag.fase3        = lg.getfase3();
            ViewBag.fase4        = lg.getfase4();
            ViewBag.fase5        = lg.getfase5();
            ViewBag.NoAsiginadas = per.CantidadclienteNoasignados(periodo);
            ViewBag.Asignados    = per.CantidadclienteAsignados(periodo);
            ViewBag.SinMora      = per.CantidadSinMora();
            ViewBag.Preventivo   = lg.GetNotificacionCount(5);
            ViewBag.total        = lg.totalClienteMora();
            return(View());
        }
        // GET: PersonasCasas/Create
        public ActionResult CreateID(string id = "")
        {
            try
            {
                LPersonaCasas lp  = new LPersonaCasas();
                var           per = lp.GetClienteXID(id);
                var           usu = new Usuario()
                {
                    Nombre    = per.NombreP,
                    Apellido1 = per.Apellido,
                    Apellido2 = per.Seg_Apellido,
                    Email     = per.Correo,
                    ID        = Convert.ToInt64(per.CodCliente)
                };
                return(PartialView("_Create", usu));
            }
            catch (System.Exception)
            {
                return(Json(""));

                throw;
            }
        }