Beispiel #1
0
        public ActionResult getTableBataSacVentaAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_sac_venta] == null)
            {
                List <Ent_Bata_Sac_Venta> listdoc = new List <Ent_Bata_Sac_Venta>();
                Session[_session_sac_venta] = listdoc;
            }
            //if (!String.IsNullOrEmpty(dniEliminar))
            //{
            //    List<Ent_BataClub_Cupones> listAct = (List<Ent_BataClub_Cupones>)(Session[_session_lista_clientes_cupon]);
            //    listAct.Remove(listAct.Where(w => w.dniCliente == dniEliminar).FirstOrDefault());
            //    Session[_session_lista_clientes_cupon] = listAct;
            //}
            //Traer registros
            IQueryable <Ent_Bata_Sac_Venta> membercol = ((List <Ent_Bata_Sac_Venta>)(Session[_session_sac_venta])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Bata_Sac_Venta> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.tienda.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.numdoc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.pedido.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }

            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.canal,
                a.tienda,
                a.tipodoc,
                a.numdoc,
                a.fecha,
                a.estado,
                a.pedido,
                a.fc_nint,
                a.cod_tda
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getGuiaAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_listguia_private] == null)
            {
                List <Ent_Consultar_Guia> listdoc = new List <Ent_Consultar_Guia>();
                Session[_session_listguia_private] = listdoc;
            }

            //Traer registros
            // string tda_destino = Request["tda_destino"];
            // string num_guia = Request["num_guia"];

            //  List<Ent_Consultar_Guia> mGuia = datGuia.get_lista(tda_destino, num_guia);

            //  IQueryable<Ent_Consultar_Guia> membercol = ((List<Ent_Consultar_Guia>)(mGuia)).AsQueryable();  //lista().AsQueryable();
            IQueryable <Ent_Consultar_Guia> membercol = ((List <Ent_Consultar_Guia>)(Session[_session_listguia_private])).AsQueryable();  //lista().AsQueryable();


            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Consultar_Guia> filteredMembers = membercol;

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.desc_almac,
                a.num_gudis,
                a.num_guia,
                a.tienda_origen,
                a.tienda_destino,
                a.fecha_des,
                a.desc_send_tda,
                a.fec_env,
                a.mc_id,
                a.fec_recep,
                a.cant_despd,
                a.cant_fmd,
                a.con_id,
                a.con_des
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult getTableconsdocDetAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_consultadoc_mov_det] == null)
            {
                List <Ent_MovDoc_Consulta_Detalle_Articulo> listdoc_det = new List <Ent_MovDoc_Consulta_Detalle_Articulo>();
                Session[_session_lista_consultadoc_mov_det] = listdoc_det;
            }
            //if (!String.IsNullOrEmpty(dniEliminar))
            //{
            //    List<Ent_BataClub_Cupones> listAct = (List<Ent_BataClub_Cupones>)(Session[_session_lista_clientes_cupon]);
            //    listAct.Remove(listAct.Where(w => w.dniCliente == dniEliminar).FirstOrDefault());
            //    Session[_session_lista_clientes_cupon] = listAct;
            //}
            //Traer registros
            IQueryable <Ent_MovDoc_Consulta_Detalle_Articulo> membercol = ((List <Ent_MovDoc_Consulta_Detalle_Articulo>)(Session[_session_lista_consultadoc_mov_det])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_MovDoc_Consulta_Detalle_Articulo> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.articulo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.linea.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.categoria.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }

            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.articulo,
                a.calidad,
                a.linea,
                a.categoria,
                a.list_talla,
                a.total,
                //a.talla,
                //a.cantidad,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getTableStockCategoriaAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_stock_articulo_categoria] == null)
            {
                List <Ent_Articulo_Categoria_Stock> liststock = new List <Ent_Articulo_Categoria_Stock>();
                Session[_session_stock_articulo_categoria] = liststock;
            }

            //}
            //Traer registros
            IQueryable <Ent_Articulo_Categoria_Stock> membercol = ((List <Ent_Articulo_Categoria_Stock>)(Session[_session_stock_articulo_categoria])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();



            IEnumerable <Ent_Articulo_Categoria_Stock> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.categoria.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.codigo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.descripcion.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tempo.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }


            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.categoria,
                a.foto,
                a.codigo,
                a.descripcion,
                a.tempo,
                a.precio,
                a.total,
                a.list_talla
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getListPromotor(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_listPromotor_private] == null)
            {
                List <Ent_Promotor> listdoc = new List <Ent_Promotor>();
                Session[_session_listPromotor_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Promotor> membercol = ((List <Ent_Promotor>)(Session[_session_listPromotor_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Promotor> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.prmt_NroDoc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.prmt_ApePater.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Promotor, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.prmt_NroDoc :
                    m.prmt_ApePater
                );
            var sortDirection = Request["sSortDir_0"];
            //if (sortDirection == "asc")
            //    filteredMembers = filteredMembers.OrderBy(orderingFunction);
            //else
            //    filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.prmt_NroDoc,
                a.prmt_Nombre1,
                a.prmt_Nombre2,
                a.prmt_ApePater,
                a.prmt_ApeMater,
                a.prmt_Correo,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #6
0
        public ActionResult getTablePromTipoAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_prom_tipo] == null)
            {
                List <Ent_Promotion_Orce_Atributos> listdoc = new List <Ent_Promotion_Orce_Atributos>();
                Session[_session_lista_prom_tipo] = listdoc;
            }
            //if (!String.IsNullOrEmpty(dniEliminar))
            //{
            //    List<Ent_BataClub_Cupones> listAct = (List<Ent_BataClub_Cupones>)(Session[_session_lista_clientes_cupon]);
            //    listAct.Remove(listAct.Where(w => w.dniCliente == dniEliminar).FirstOrDefault());
            //    Session[_session_lista_clientes_cupon] = listAct;
            //}
            //Traer registros
            IQueryable <Ent_Promotion_Orce_Atributos> membercol = ((List <Ent_Promotion_Orce_Atributos>)(Session[_session_lista_prom_tipo])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Promotion_Orce_Atributos> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.promotion_id.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.deal_id.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tipo.ToUpper().Contains(param.sSearch.ToUpper()) || m.attribute_name.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.attribute_value.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }

            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.promotion_id,
                a.deal_id,
                a.tipo,
                a.attribute_name,
                a.attribute_value,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getDataPagsLiqs(Ent_jQueryDataTableParams param, bool checking = false, string checkVal = "")
        {
            /*verificar si esta null*/
            if (Session[_sessionPagsLiqs] == null)
            {
                List <Ent_Pag_Liq> listPed = new List <Ent_Pag_Liq>();
                Session[_sessionPagsLiqs] = listPed;
            }
            if (checking)
            {
                List <Ent_Pag_Liq> list = (List <Ent_Pag_Liq>)Session[_sessionPagsLiqs];
                list.Where(w => w.dtv_transdoc_id == checkVal).Select(s => { s.checks = !s.checks; return(s); }).ToList();
                Session[_sessionPagsLiqs] = list;
            }

            //Traer registros

            IQueryable <Ent_Pag_Liq> membercol = ((List <Ent_Pag_Liq>)(Session[_sessionPagsLiqs])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Pag_Liq> filteredMembers = membercol;


            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.dtv_transdoc_id,
                a.dtv_concept_id,
                a.cov_description,
                //document_date_desc = a.document_date_desc.ToString("dd/MM/yyyy hh:mm"),
                a.document_date_desc,
                a.dtd_document_date,
                a.debito,
                a.credito,
                a.val,
                a.TIPO,
                a.active,
                a.checks,
                a.von_increase,
                a.Flag,
                monto = a.val * a.von_increase
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result,
                total = membercol.Where(w => w.checks).Sum(s => s.val * s.von_increase)
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getTableArticuloPrecioAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_articulo_precio] == null)
            {
                List <Ent_Articulo_Precio> listarticulo_precio = new List <Ent_Articulo_Precio>();
                Session[_session_lista_articulo_precio] = listarticulo_precio;
            }

            //}
            //Traer registros
            IQueryable <Ent_Articulo_Precio> membercol = ((List <Ent_Articulo_Precio>)(Session[_session_lista_articulo_precio])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();



            IEnumerable <Ent_Articulo_Precio> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.articulo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.Art_Temporada.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }


            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.tipo,
                a.tipodes,
                a.articulo,
                a.descripcion,
                a.precioigv,
                a.precion,
                a.Art_Temporada,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #9
0
        //Dropdownlist - cambio de fechas
        public ActionResult getDropdrowlistFecha(Ent_jQueryDataTableParams param, string valor_tienda)
        {
            ViewBag.Fecha = datInv.get_ListaFecha(valor_tienda);

            //return Json(new[] {
            //    ViewBag.Fecha
            //}, JsonRequestBehavior.AllowGet);
            return(Json(
                       ViewBag.Fecha
                       , JsonRequestBehavior.AllowGet));
        }
        public ActionResult getTablePremioArticuloListaAjax(Ent_jQueryDataTableParams param, string actualizar, string idpremio)
        {
            List <Ent_Lista_PremiosXArticulos> liststock = new List <Ent_Lista_PremiosXArticulos>();

            if (!String.IsNullOrEmpty(actualizar))
            {
                liststock = premio.lista_premiosXarticulo(Convert.ToInt32(idpremio));
                //listAtributos = datOE.get_lista_atributos();
                Session[_session_lista_premios_lista_articulos] = liststock;
            }

            /*verificar si esta null*/
            if (Session[_session_lista_premios_lista_articulos] == null)
            {
                liststock = new List <Ent_Lista_PremiosXArticulos>();
                Session[_session_lista_premios_lista_articulos] = liststock;
            }

            //}
            //Traer registros
            IQueryable <Ent_Lista_PremiosXArticulos> membercol = ((List <Ent_Lista_PremiosXArticulos>)(Session[_session_lista_premios_lista_articulos])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Lista_PremiosXArticulos> filteredMembers = membercol;


            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.id,
                a.articulo,
                a.talla,
                a.cantidad,
                a.entregado,
                a.stock
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getTablePremiosListaAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_premios] == null)
            {
                List <Ent_Premios> listpremios = new List <Ent_Premios>();
                Session[_session_lista_premios] = premio.lista_premios();
            }

            //}
            //Traer registros
            IQueryable <Ent_Premios> membercol = ((List <Ent_Premios>)(Session[_session_lista_premios])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();



            IEnumerable <Ent_Premios> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.descripcion.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }


            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.id,
                a.descripcion,
                a.monto,
                a.stock,
                a.stockingresado,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #12
0
        public ActionResult getGuiaErrorAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_consulta_guiaerrores] == null)
            {
                List <Ent_Consulta_GuiaError> listdoc = new List <Ent_Consulta_GuiaError>();
                Session[_session_consulta_guiaerrores] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Consulta_GuiaError> membercol = ((List <Ent_Consulta_GuiaError>)(Session[_session_consulta_guiaerrores])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Consulta_GuiaError> filteredMembers = membercol;

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.Codigo,
                a.Caja,
                a.TK_xstore,
                a.Tienda,
                a.Fec_Documento,
                a.Num_Documento,
                a.Articulo,
                a.Calidad,
                a.Cantidad,
                a.Fec_Ingreso,
                a.Fec_Act,
                a.Mantis_Nro,
                a.Estado,
                a.TK_soporte_Bata
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #13
0
        public ActionResult getTableCuponCompartirAjax(Ent_jQueryDataTableParams param, string dniEliminar)
        {
            /*verificar si esta null*/
            if (Session[_session_listcompartir_private_cupones] == null)
            {
                List <Ent_Barra_Compartir> listdoc = new List <Ent_Barra_Compartir>();
                Session[_session_listcompartir_private_cupones] = listdoc;
            }
            //Traer registros
            IQueryable <Ent_Barra_Compartir> membercol = ((List <Ent_Barra_Compartir>)(Session[_session_listcompartir_private_cupones])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Barra_Compartir> filteredMembers = membercol;

            //if (!string.IsNullOrEmpty(param.sSearch))
            //{
            //    filteredMembers = membercol
            //        .Where(m =>
            //        m.correo.ToUpper().Contains(param.sSearch.ToUpper()) ||
            //        m.nombresCliente.ToUpper().Contains(param.sSearch.ToUpper()) ||
            //        m.dniCliente.ToUpper().Contains(param.sSearch.ToUpper()) || m.apellidosCliente.ToUpper().Contains(param.sSearch.ToUpper()) ||
            //        (m.nombresCliente.Trim() + " " + m.apellidosCliente.Trim()).ToUpper().Contains(param.sSearch.ToUpper())
            //        );
            //}

            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.barra,
                a.estado,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #14
0
        public ActionResult getGuiaAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_doc_transac_private] == null)
            {
                List <Ent_Documento_Transac> listdoc = new List <Ent_Documento_Transac>();
                Session[_session_doc_transac_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Documento_Transac> membercol = ((List <Ent_Documento_Transac>)(Session[_session_doc_transac_private])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Documento_Transac> filteredMembers = membercol;

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.cod_entid,
                a.tienda_origen,
                a.tran_id,
                a.fecha_des,
                a.flg_novell,
                a.fec_env
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getTableArticuloSinStockAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_pedido_sin_stock] == null)
            {
                List <Ent_Articulo_Sin_Stock> liststock = new List <Ent_Articulo_Sin_Stock>();
                Session[_session_pedido_sin_stock] = liststock;
            }

            //}
            //Traer registros
            IQueryable <Ent_Articulo_Sin_Stock> membercol = ((List <Ent_Articulo_Sin_Stock>)(Session[_session_pedido_sin_stock])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Articulo_Sin_Stock> filteredMembers = membercol;


            //Manejador de orden
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.pedido,
                a.dni,
                a.nombres,
                a.articulo,
                a.talla,
                a.estado,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        /** Lista Documentos **/
        public ActionResult getListDocumentosDev(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_listDocDev_private] == null)
            {
                List <Ent_Documentos_Dev> listPed = new List <Ent_Documentos_Dev>();
                Session[_session_listDocDev_private] = listPed;
            }

            //Traer registros
            IQueryable <Ent_Documentos_Dev> membercol = ((List <Ent_Documentos_Dev>)(Session[_session_listDocDev_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Documentos_Dev> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.TIPODOC.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.NDOC.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            if (param.iSortingCols > 0)
            {
                if (Request["sSortDir_0"].ToString() == "asc")
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderBy(o => o.TIPODOC); break;

                    case 1: filteredMembers = filteredMembers.OrderBy(o => o.NDOC); break;

                    case 2: filteredMembers = filteredMembers.OrderBy(o => Convert.ToDateTime(o.FDOC)).ThenBy(to => Convert.ToDecimal(to.FDOC)); break;
                        //case 3: filteredMembers = filteredMembers.OrderBy(o => o.Pares); break;
                        //case 4: filteredMembers = filteredMembers.OrderBy(o => o.Estado); break;
                        //case 5: filteredMembers = filteredMembers.OrderBy(o => o.Ganancia); break;
                        //case 6: filteredMembers = filteredMembers.OrderBy(o => o.Subtotal); break;
                        //case 7: filteredMembers = filteredMembers.OrderBy(o => o.N_C); break;
                        //case 8: filteredMembers = filteredMembers.OrderBy(o => o.Total); break;
                        //case 9: filteredMembers = filteredMembers.OrderBy(o => o.Percepcion); break;
                        //case 10: filteredMembers = filteredMembers.OrderBy(o => o.TotalPagar); break;
                    }
                }
                else
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderByDescending(o => o.TIPODOC); break;

                    case 1: filteredMembers = filteredMembers.OrderByDescending(o => o.NDOC); break;

                    case 2: filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToDateTime(o.FDOC)).ThenBy(to => Convert.ToDecimal(to.FDOC)); break;
                        //case 3: filteredMembers = filteredMembers.OrderByDescending(o => o.Pares); break;
                        //case 4: filteredMembers = filteredMembers.OrderByDescending(o => o.Estado); break;
                        //case 5: filteredMembers = filteredMembers.OrderByDescending(o => o.Ganancia); break;
                        //case 6: filteredMembers = filteredMembers.OrderByDescending(o => o.Subtotal); break;
                        //case 7: filteredMembers = filteredMembers.OrderByDescending(o => o.N_C); break;
                        //case 8: filteredMembers = filteredMembers.OrderByDescending(o => o.Total); break;
                        //case 9: filteredMembers = filteredMembers.OrderByDescending(o => o.Percepcion); break;
                        //case 10: filteredMembers = filteredMembers.OrderByDescending(o => o.TotalPagar); break;
                    }
                }
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.TIPODOC,
                a.NDOC,
                a.FDOC,
                a.SUBTOTAL,
                a.IGV,
                a.TOTAL,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #17
0
        public ActionResult getAnalisisMov(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_listanalisisDetalle_private] == null)
            {
                List <Ent_Analisis_Mov> listdoc = new List <Ent_Analisis_Mov>();
                Session[_session_listanalisisDetalle_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Analisis_Mov> membercol = ((List <Ent_Analisis_Mov>)(Session[_session_listanalisisDetalle_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Analisis_Mov> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.tipo_doc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.num_doc.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Analisis_Mov, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.tipo_doc :
                    m.num_doc
                );
            var sortDirection = Request["sSortDir_0"];
            //if (sortDirection == "asc")
            //    filteredMembers = filteredMembers.OrderBy(orderingFunction);
            //else
            //    filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.item,
                a.fecha,
                a.tipo_doc,
                a.num_doc,
                a.origen,
                a.destino,
                a.inicial,
                a.ingreso,
                a.salida,
                a.saldo,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #18
0
        public ActionResult getconsultadocmov(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_consultadoc_mov] == null)
            {
                List <Ent_MovDoc_Consulta> lisprom = new List <Ent_MovDoc_Consulta>();
                Session[_session_lista_consultadoc_mov] = lisprom;
            }

            //Traer registros
            IQueryable <Ent_MovDoc_Consulta> membercol = ((List <Ent_MovDoc_Consulta>)(Session[_session_lista_consultadoc_mov])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_MovDoc_Consulta> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.tipo_doc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tipo_transac.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.num_doc.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            //Func<Models_Guia, string> orderTO = (m => m.TIENDA_ORI);
            //Func<Models_Guia, string> orderNumero = (m => m.NUMERO);
            //Func<Models_Guia, DateTime> orderFecha = (m => Convert.ToDateTime(m.FECHA));
            //Func<Models_Guia, int> orderPares = (m => Convert.ToInt32(m.PARES));
            //Func<Models_Guia, double> orderVC = (m => Convert.ToDouble(m.VCALZADO));
            //Func<Models_Guia, int> orderNC = (m => Convert.ToInt32(m.NOCALZADO));
            //Func<Models_Guia, double> orderVNC = (m => Convert.ToDouble(m.VNOCALZADO));
            //Func<Models_Guia, string> orderEstado = (m => m.ESTADO);

            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "asc")
            {
                switch (sortIdx)
                {
                case 1: filteredMembers = filteredMembers.OrderBy(o => o.tipo_transac); break;

                case 2: filteredMembers = filteredMembers.OrderBy(o => o.tipo_doc); break;

                case 3: filteredMembers = filteredMembers.OrderBy(o => o.num_doc); break;

                case 4: filteredMembers = filteredMembers.OrderBy(o => Convert.ToDateTime(o.fecha_doc)); break;

                case 5: filteredMembers = filteredMembers.OrderBy(o => o.cant); break;

                case 6: filteredMembers = filteredMembers.OrderBy(o => o.tda_ori); break;

                case 7: filteredMembers = filteredMembers.OrderBy(o => o.tda_des); break;


                default: break;
                }
            }
            else
            {
                switch (sortIdx)
                {
                case 1: filteredMembers = filteredMembers.OrderByDescending(o => o.tipo_transac); break;

                case 2: filteredMembers = filteredMembers.OrderByDescending(o => o.tipo_doc); break;

                case 3: filteredMembers = filteredMembers.OrderByDescending(o => o.num_doc); break;

                case 4: filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToDateTime(o.fecha_doc)); break;

                case 5: filteredMembers = filteredMembers.OrderByDescending(o => o.cant); break;

                case 6: filteredMembers = filteredMembers.OrderByDescending(o => o.tda_ori); break;

                case 7: filteredMembers = filteredMembers.OrderByDescending(o => o.tda_des); break;


                default: break;
                }
            }
            var displayMembers = filteredMembers.Skip(param.iDisplayStart).Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.mc_id,
                a.tienda,
                a.tipo_transac,
                a.tipo_doc,
                a.num_doc,
                a.fecha_doc,
                a.cant,
                a.tda_des,
                a.tda_ori,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #19
0
        public ActionResult getTableInventAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_tabla_inventCons_private] == null)
            {
                List <Ent_Inventario_Consulta> listdoc = new List <Ent_Inventario_Consulta>();
                Session[_session_tabla_inventCons_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Inventario_Consulta> membercol = ((List <Ent_Inventario_Consulta>)(Session[_session_tabla_inventCons_private])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Inventario_Consulta> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.articulo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.calidad.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         //  m.des_entid.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.diferencia.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.talla.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         //  m.fecha_inv.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.teorico.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.fisico.ToUpper().Contains(param.sSearch.ToUpper()));
            }

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            Func <Ent_Inventario_Consulta, string> orderingFunction =
                (
                    //m => sortIdx == 0 ? m.fec_doc :
                    // m.fec_doc
                    m => sortIdx == 0 ? m.fecha_inv :
                    sortIdx == 1 ? m.articulo :
                    sortIdx == 2 ? m.talla :
                    sortIdx == 3 ? m.fisico :
                    m.diferencia
                );

            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "asc")
            {
                filteredMembers = filteredMembers.OrderBy(orderingFunction);
            }
            else
            {
                filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.articulo,
                a.calidad,
                a.des_entid,
                a.diferencia,
                a.fecha_inv,
                a.fisico,
                a.teorico,
                a.talla
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #20
0
        public ActionResult getInvArtAjax(Ent_jQueryDataTableParams param, bool corteInventario, string tienda, string fecha)//, string _art_mod, bool ordenar, bool _all_check, bool _all_check_val)
        {
            /*verificar si esta null*/
            if (corteInventario)
            {
                List <Ent_Inv_Ajuste_Articulos> list = datInv.getListaTeorico(tienda, Convert.ToDateTime(fecha));
                Session[_session_lista_articulos_inv] = list;
            }
            if (Session[_session_lista_articulos_inv] == null)
            {
                List <Ent_Inv_Ajuste_Articulos> list = new List <Ent_Inv_Ajuste_Articulos>();
                Session[_session_lista_articulos_inv] = list;
            }

            IQueryable <Ent_Inv_Ajuste_Articulos> membercol = ((List <Ent_Inv_Ajuste_Articulos>)Session[_session_lista_articulos_inv]).AsQueryable();  //lista().AsQueryable();

            //displayMembers.Select(a => { a.ESTADO_CONEXION_CAJA_XST = dat_storeTda.PingHost(a.IP); return a; }).ToList();
            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Inv_Ajuste_Articulos> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.ARTICULO.ToUpper().Contains(param.sSearch.ToUpper()) || m.MEDIDA.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden

            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Inv_Ajuste_Articulos, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.ARTICULO : m.CALIDAD.ToString());

            Func <Ent_Inv_Ajuste_Articulos, string>   orderingCodigo     = (m => m.ARTICULO);
            Func <Ent_Inv_Ajuste_Articulos, string>   orderingCalidad    = (m => m.CALIDAD);
            Func <Ent_Inv_Ajuste_Articulos, string>   orderingMedida     = (m => m.MEDIDA);
            Func <Ent_Inv_Ajuste_Articulos, decimal?> orderingFisico     = (m => m.STOCK);
            Func <Ent_Inv_Ajuste_Articulos, decimal?> orderingTeorico    = (m => m.TEORICO);
            Func <Ent_Inv_Ajuste_Articulos, decimal?> orderingDiferencia = (m => m.DIFERENCIA);

            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "asc")
            {
                if (sortIdx == 0)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingCodigo);
                }
                else if (sortIdx == 1)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingCalidad);
                }
                else if (sortIdx == 2)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingMedida);
                }
                else if (sortIdx == 3)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingFisico);
                }
                else if (sortIdx == 4)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingTeorico);
                }
                else if (sortIdx == 5)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingDiferencia);
                }
            }
            else
            {
                if (sortIdx == 0)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingCodigo);
                }
                else if (sortIdx == 1)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingCalidad);
                }
                else if (sortIdx == 2)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingMedida);
                }
                else if (sortIdx == 3)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingFisico);
                }
                else if (sortIdx == 4)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingTeorico);
                }
                else if (sortIdx == 5)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingDiferencia);
                }
            }

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.ARTICULO,
                a.CALIDAD,
                a.MEDIDA,
                a.TEORICO,
                a.STOCK,
                a.DIFERENCIA
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #21
0
        public ActionResult getListaAjustesInvAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_lista_ajuste_inv] == null)
            {
                List <Ent_Inventario_Ajuste> list = new List <Ent_Inventario_Ajuste>();
                Session[_session_lista_ajuste_inv] = list;
            }

            IQueryable <Ent_Inventario_Ajuste> membercol = ((List <Ent_Inventario_Ajuste>)Session[_session_lista_ajuste_inv]).AsQueryable();  //lista().AsQueryable();

            int totalCount = membercol.Count();

            IEnumerable <Ent_Inventario_Ajuste> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.TIENDA.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.DESCRIPCION.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.FECHA_INV.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.CODIGO.ToString().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden

            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            Func <Ent_Inventario_Ajuste, decimal>  orderingCodigo      = (m => m.CODIGO);
            Func <Ent_Inventario_Ajuste, string>   orderingTienda      = (m => m.TIENDA);
            Func <Ent_Inventario_Ajuste, string>   orderingDescripcion = (m => m.DESCRIPCION);
            Func <Ent_Inventario_Ajuste, DateTime> orderingFecha       = (m => Convert.ToDateTime(m.FECHA_INV));
            Func <Ent_Inventario_Ajuste, decimal>  orderingFisico      = (m => m.FISICO);
            Func <Ent_Inventario_Ajuste, decimal>  orderingTeorico     = (m => m.TEORICO);
            Func <Ent_Inventario_Ajuste, decimal>  orderingDiferencia  = (m => m.DIFERENCIA);

            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "asc")
            {
                if (sortIdx == 0)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingCodigo);
                }
                else if (sortIdx == 1)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingTienda);
                }
                else if (sortIdx == 2)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingDescripcion);
                }
                else if (sortIdx == 3)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingFecha);
                }
                else if (sortIdx == 4)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingFisico);
                }
                else if (sortIdx == 5)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingTeorico);
                }
                else if (sortIdx == 6)
                {
                    filteredMembers = filteredMembers.OrderBy(orderingDiferencia);
                }
            }
            else
            {
                if (sortIdx == 0)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingCodigo);
                }
                else if (sortIdx == 1)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingTienda);
                }
                else if (sortIdx == 2)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingDescripcion);
                }
                else if (sortIdx == 3)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingFecha);
                }
                else if (sortIdx == 4)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingFisico);
                }
                else if (sortIdx == 5)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingTeorico);
                }
                else if (sortIdx == 6)
                {
                    filteredMembers = filteredMembers.OrderByDescending(orderingDiferencia);
                }
            }

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.CODIGO,
                a.TIENDA,
                a.DESCRIPCION,
                a.FECHA_INV,
                a.FISICO,
                a.TEORICO,
                a.DIFERENCIA
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #22
0
        public ActionResult getDetalleAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_doc_transac_doc_private] == null)
            {
                List <Ent_Documento_TransacDoc> listdoc = new List <Ent_Documento_TransacDoc>();
                Session[_session_doc_transac_doc_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Documento_TransacDoc> membercol = ((List <Ent_Documento_TransacDoc>)(Session[_session_doc_transac_doc_private])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Documento_TransacDoc> filteredMembers = membercol;

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Documento_TransacDoc, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.NUM_FAC :
                    m.NUM_FAC
                );

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.NUM_FAC.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.TIPO_DOC.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "desc")
            {
                filteredMembers = filteredMembers.OrderBy(orderingFunction);
            }
            else
            {
                filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            //var displayMembers = filteredMembers
            //    .Skip(param.iDisplayStart)
            //    .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.TIPO_DOC,
                a.NUM_FAC,
                a.SERIE,
                a.TOTAL,
                a.ESTADO
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #23
0
        public ActionResult ListarConsultaMovimiento_DataTable(Ent_jQueryDataTableParams param)
        {
            if (Session["Lista_Consulta_Movimiento"] == null)
            {
                List <Ent_Consulta_Movimiento> liststoreConf = new List <Ent_Consulta_Movimiento>();
                Session["Lista_Consulta_Movimiento"] = liststoreConf;
            }
            IQueryable <Ent_Consulta_Movimiento> membercol = ((List <Ent_Consulta_Movimiento>)(Session["Lista_Consulta_Movimiento"])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Consulta_Movimiento> filteredMembers = membercol;


            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.FECHA.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.FECHA.ToUpper().Contains(param.sSearch.ToUpper()));
            }

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Consulta_Movimiento, DateTime> orderingFunction =
                (
                    m => Convert.ToDateTime(m.FECHA));

            filteredMembers = filteredMembers.OrderBy(orderingFunction);
            //var sortDirection = Request["sSortDir_0"];
            //if (sortDirection == "asc")
            //    filteredMembers = filteredMembers.OrderBy(orderingFunction);
            //else
            //    filteredMembers = filteredMembers.OrderByDescending(orderingFunction);

            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);


            var result = from a in displayMembers
                         select new
            {
                a.TIENDA,
                a.FECHA,
                a.INI_CALZADO,
                a.INI_NO_CALZADO,
                a.VEN_CALZADO,
                a.VEN_NO_CALZADO,
                a.ING_CALZADO,
                a.ING_NO_CALZADO,
                a.SAL_CALZADO,
                a.SAL_NO_CALZADO,
                a.SALDO_CALZADO,
                a.SALDO_NO_CALZADO
            };

            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = membercol.Count(),
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #24
0
        public ActionResult getComAjax(Ent_jQueryDataTableParams param, string noLeidos)
        {
            /*verificar si esta null*/
            if (Session[_session_listcom_private] == null)
            {
                List <Ent_Comunicado> listcom = new List <Ent_Comunicado>();
                if (Session["Tienda"] != null)
                {
                    listcom = listaCom(Session["Tienda"].ToString());
                }
                Session[_session_listcom_private] = listcom;
            }

            //Traer registros
            // string tda_destino = Request["tda_destino"];
            // string num_guia = Request["num_guia"];

            //  List<Ent_Consultar_Guia> mGuia = datGuia.get_lista(tda_destino, num_guia);

            //  IQueryable<Ent_Consultar_Guia> membercol = ((List<Ent_Consultar_Guia>)(mGuia)).AsQueryable();  //lista().AsQueryable();
            IQueryable <Ent_Comunicado> membercol = ((List <Ent_Comunicado>)(Session[_session_listcom_private])).AsQueryable();  //lista().AsQueryable();


            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Comunicado> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.descripcion.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.archivo.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden
            //0 = ID
            //5 = fecha envio
            //6 = fecha leido
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Comunicado, DateTime> orderingFunctionFE = (m => Convert.ToDateTime(m.fecha_hora_mod));
            Func <Ent_Comunicado, decimal>  orderingFunctionID = (m => m.id);
            Func <Ent_Comunicado, string>   orderingFunctionFL = (m => m.file_leido_fecha);

            var     sortDirection = Request["sSortDir_0"];
            Boolean order_colum   = false;

            if (param != null)
            {
                if (param.sEcho != "1")
                {
                    order_colum = true;
                }
            }

            if (order_colum)
            {
                if (sortDirection == "asc")
                {
                    if (sortIdx == 0)
                    {
                        filteredMembers = filteredMembers.OrderBy(orderingFunctionID);
                    }
                    else if (sortIdx == 5)
                    {
                        filteredMembers = filteredMembers.OrderBy(orderingFunctionFE);
                    }
                    else
                    {
                        filteredMembers = filteredMembers.OrderBy(orderingFunctionFL);
                    }
                }
                else
                {
                    if (sortIdx == 0)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(orderingFunctionID);
                    }
                    else if (sortIdx == 5)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(orderingFunctionFE);
                    }
                    else
                    {
                        filteredMembers = filteredMembers.OrderByDescending(orderingFunctionFL);
                    }
                }
            }

            if (Convert.ToBoolean(noLeidos))
            {
                filteredMembers = filteredMembers.Where(m => m.file_leido == false).OrderByDescending(orderingFunctionFE);
            }


            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.id,
                a.tienda,
                a.archivo,
                a.descripcion,
                a.url,
                a.fecha,
                a.fecha_hora_mod,
                a.file_leido_fecha,
                a.file_leido,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getValeCompra(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_listValeCompraDetalle_private] == null)
            {
                List <Reporte_Resultado> listValeCompra = new List <Reporte_Resultado>();
                Session[_session_listValeCompraDetalle_private] = listValeCompra;
            }

            //Traer registros
            IQueryable <Reporte_Resultado> membercol = ((List <Reporte_Resultado>)(Session[_session_listValeCompraDetalle_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Reporte_Resultado> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.Codigo_tda.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.Desc_tda.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.Codigo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.Numero.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.Estado.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Reporte_Resultado, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.Codigo_tda :
                    sortIdx == 1 ? m.Desc_tda :
                    sortIdx == 2 ? m.Codigo :
                    sortIdx == 3 ? m.Numero :
                    m.Estado
                );
            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "asc")
            {
                filteredMembers = filteredMembers.OrderBy(orderingFunction);
            }
            else
            {
                filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.Institucion,
                a.Codigo,
                a.Numero,
                a.soles,
                a.Estado,
                a.Codigo_tda,
                a.Desc_tda,
                a.Documento,
                a.Fecha_doc,
                a.DNI,
                a.Cliente
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getListaAplicacionAjax(Ent_jQueryDataTableParams param, string actualizar)
        {
            List <Ent_Aplicacion> listaplicacion = new List <Ent_Aplicacion>();

            if (!String.IsNullOrEmpty(actualizar))
            {
                listaplicacion = lista();
                //listAtributos = datOE.get_lista_atributos();
                Session[_session_listaplicacion_private] = listaplicacion;
            }

            /*verificar si esta null*/
            if (Session[_session_listaplicacion_private] == null)
            {
                listaplicacion = new List <Ent_Aplicacion>();
                listaplicacion = lista(); //datOE.get_lista_atributos();
                if (listaplicacion == null)
                {
                    listaplicacion = new List <Ent_Aplicacion>();
                }
                Session[_session_listaplicacion_private] = listaplicacion;
            }

            //Traer registros

            IQueryable <Ent_Aplicacion> membercol = ((List <Ent_Aplicacion>)(Session[_session_listaplicacion_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Aplicacion> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.apl_id.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.apl_nombre.ToString().ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.apl_orden.ToString().ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.apl_controller.ToString().ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.apl_action.ToString().ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }
            //Manejador de orden
            var sortIdx       = Convert.ToInt32(Request["iSortCol_0"]);
            var sortDirection = Request["sSortDir_0"];

            if (param.iSortingCols > 0)
            {
                if (sortDirection == "asc")
                {
                    if (sortIdx == 0)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.apl_id);
                    }
                    else if (sortIdx == 1)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.apl_nombre);
                    }
                    else if (sortIdx == 2)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.apl_orden);
                    }
                    else if (sortIdx == 3)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.apl_controller);
                    }
                    else if (sortIdx == 4)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.apl_action);
                    }
                }
                else
                {
                    if (sortIdx == 0)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.apl_id);
                    }
                    else if (sortIdx == 1)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.apl_nombre);
                    }
                    else if (sortIdx == 2)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.apl_orden);
                    }
                    else if (sortIdx == 3)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.apl_controller);
                    }
                    else if (sortIdx == 4)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.apl_action);
                    }
                }
            }

            //Func<Ent_Funcion, DateTime> orderingFunction =
            //    (
            //        m => Convert.ToDateTime(m.FECHA_CREACION)
            //    );
            //var sortDirection = Request["sSortDir_0"];
            //if (sortDirection == "asc")
            //    filteredMembers = filteredMembers.OrderBy(orderingFunction);
            //else
            //    filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);
            var result = from a in displayMembers
                         select new
            {
                a.apl_id,
                a.apl_nombre,
                a.apl_orden,
                a.apl_controller,
                a.apl_action,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #27
0
        public ActionResult getListPedSepAjax(Ent_jQueryDataTableParams param, string actualizar)
        {
            List <Ent_Pedido_Separado> listpedido = new List <Ent_Pedido_Separado>();

            if (!String.IsNullOrEmpty(actualizar))
            {
                listpedido = lista();
                //listAtributos = datOE.get_lista_atributos();
                Session[_session_listPedidoSeparado_private] = listpedido;
            }

            /*verificar si esta null*/
            if (Session[_session_listPedidoSeparado_private] == null)
            {
                listpedido = new List <Ent_Pedido_Separado>();
                listpedido = lista(); //datOE.get_lista_atributos();
                if (listpedido == null)
                {
                    listpedido = new List <Ent_Pedido_Separado>();
                }
                Session[_session_listPedidoSeparado_private] = listpedido;
            }


            //Traer registros
            IQueryable <Ent_Pedido_Separado> membercol = ((List <Ent_Pedido_Separado>)(Session[_session_listPedidoSeparado_private])).AsQueryable();  //lista().AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();
            IEnumerable <Ent_Pedido_Separado> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.asesor.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.lider.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.pedido.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.promotor.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }
            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            if (param.iSortingCols > 0)
            {
                if (Request["sSortDir_0"].ToString() == "asc")
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderBy(o => o.asesor); break;

                    case 1: filteredMembers = filteredMembers.OrderBy(o => o.lider); break;

                    case 2: filteredMembers = filteredMembers.OrderBy(o => o.promotor); break;

                    case 4: filteredMembers = filteredMembers.OrderBy(o => Convert.ToInt32(o.tcantidad)); break;

                    case 5: filteredMembers = filteredMembers.OrderBy(o => Convert.ToInt32(o.subtotal)); break;

                    case 8: filteredMembers = filteredMembers.OrderBy(o => Convert.ToInt32(o.dias_pedido)); break;
                    }
                }
                else
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderByDescending(o => o.asesor); break;

                    case 1: filteredMembers = filteredMembers.OrderByDescending(o => o.lider); break;

                    case 2: filteredMembers = filteredMembers.OrderByDescending(o => o.promotor); break;

                    case 4: filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToInt32(o.tcantidad)); break;

                    case 5: filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToInt32(o.subtotal)); break;

                    case 8: filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToInt32(o.dias_pedido)); break;
                    }
                }
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);


            var result = from a in displayMembers
                         select new
            {
                a.asesor,
                a.lider,
                a.promotor,
                a.pedido,
                a.tcantidad,
                a.fecha_ing,
                a.fecha_cad,
                a.dias_pedido,
                a.telefono,
                a.celular,
                a.ubicacion,
                a.subtotal,
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #28
0
        public JsonResult getLisXCenter_NC(Ent_jQueryDataTableParams param, string FechaInicio, string FechaFin, string Tienda, string Num_Doc, bool isOkUpdate)
        {
            Ent_Extender_NC _ent = new Ent_Extender_NC();

            _ent.Tienda      = Tienda;
            _ent.Num_Doc     = Num_Doc;
            _ent.FechaInicio = DateTime.Parse(FechaInicio);
            _ent.FechaFin    = DateTime.Parse(FechaFin);

            if (isOkUpdate)
            {
                Session[_session_LisXCenter_NC] = datGuia.LisXCenter_NC(_ent).ToList();
            }

            /*verificar si esta null*/
            if (Session[_session_LisXCenter_NC] == null)
            {
                List <Ent_Extender_NC> ListarXCenter_NC = new List <Ent_Extender_NC>();
                Session[_session_LisXCenter_NC] = ListarXCenter_NC;
            }

            IQueryable <Ent_Extender_NC> entDocTrans = ((List <Ent_Extender_NC>)(Session[_session_LisXCenter_NC])).AsQueryable();

            //Manejador de filtros
            int totalCount = entDocTrans.Count();
            IEnumerable <Ent_Extender_NC> filteredMembers = entDocTrans;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = entDocTrans
                                  .Where(m =>
                                         m.Serial_Nbr.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.String_Value.ToUpper().Contains(param.sSearch.ToUpper())
                                         );
            }

            //Manejador de ordene
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            if (param.iSortingCols > 0)
            {
                if (Request["sSortDir_0"].ToString() == "asc")
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderBy(o => o.Serial_Nbr); break;

                    case 1: filteredMembers = filteredMembers.OrderBy(o => o.Organization_Id); break;

                    case 2: filteredMembers = filteredMembers.OrderBy(o => o.Rtl_Loc_Id); break;

                    case 3: filteredMembers = filteredMembers.OrderBy(o => o.Wkstn_Id); break;

                    case 4: filteredMembers = filteredMembers.OrderBy(o => o.Trans_Seq); break;

                    case 5: filteredMembers = filteredMembers.OrderBy(o => o.String_Value); break;

                    case 6: filteredMembers = filteredMembers.OrderBy(o => o.Business_Date); break;

                    case 7: filteredMembers = filteredMembers.OrderBy(o => o.Expr_Date); break;
                    }
                }
                else
                {
                    switch (sortIdx)
                    {
                    case 0: filteredMembers = filteredMembers.OrderByDescending(o => o.Serial_Nbr); break;

                    case 1: filteredMembers = filteredMembers.OrderByDescending(o => o.Organization_Id); break;

                    case 2: filteredMembers = filteredMembers.OrderByDescending(o => o.Rtl_Loc_Id); break;

                    case 3: filteredMembers = filteredMembers.OrderByDescending(o => o.Wkstn_Id); break;

                    case 4: filteredMembers = filteredMembers.OrderByDescending(o => o.Trans_Seq); break;

                    case 5: filteredMembers = filteredMembers.OrderByDescending(o => o.String_Value); break;

                    case 6: filteredMembers = filteredMembers.OrderByDescending(o => o.Business_Date); break;

                    case 7: filteredMembers = filteredMembers.OrderByDescending(o => o.Expr_Date); break;
                    }
                }
            }

            var Result = filteredMembers
                         .Skip(param.iDisplayStart)
                         .Take(param.iDisplayLength);

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = Result
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getDetAjax(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_contabilidad_num_private] == null)
            {
                List <Ent_Contabilidad_EstadoDocumento> listdoc = new List <Ent_Contabilidad_EstadoDocumento>();
                Session[_session_contabilidad_num_private] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Contabilidad_EstadoDocumento> membercol = ((List <Ent_Contabilidad_EstadoDocumento>)(Session[_session_contabilidad_num_private])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Contabilidad_EstadoDocumento> filteredMembers = membercol;

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);
            Func <Ent_Contabilidad_EstadoDocumento, string> orderingFunction =
                (
                    m => sortIdx == 0 ? m.fecha :
                    m.fecha
                );

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m => m.estado.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.fecha.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.numero.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.serie.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tienda.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tipo_doc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.ruc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.login_ws.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.clave_ws.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tipodoc.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.folio.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.total.ToUpper().Contains(param.sSearch.ToUpper()));
            }
            var sortDirection = Request["sSortDir_0"];

            if (sortDirection == "desc")
            {
                filteredMembers = filteredMembers.OrderBy(orderingFunction);
            }
            else
            {
                filteredMembers = filteredMembers.OrderByDescending(orderingFunction);
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.estado,
                a.fecha,
                a.numero,
                a.serie,
                a.tienda,
                a.tipo_doc,
                a.total,
                a.ruc,
                a.login_ws,
                a.clave_ws,
                a.tipodoc,
                a.folio
            };

            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result
            }, JsonRequestBehavior.AllowGet));
        }
Beispiel #30
0
        public ActionResult getTablaCuponesRetorno(Ent_jQueryDataTableParams param)
        {
            /*verificar si esta null*/
            if (Session[_session_cupones_retorno] == null)
            {
                List <Ent_Ticket_Retorno> listdoc = new List <Ent_Ticket_Retorno>();
                Session[_session_cupones_retorno] = listdoc;
            }

            //Traer registros
            IQueryable <Ent_Ticket_Retorno> membercol = ((List <Ent_Ticket_Retorno>)(Session[_session_cupones_retorno])).AsQueryable();

            //Manejador de filtros
            int totalCount = membercol.Count();

            IEnumerable <Ent_Ticket_Retorno> filteredMembers = membercol;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredMembers = membercol
                                  .Where(m =>
                                         m.codigo.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.estado.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tiendaGen.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.fechaGen.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.tiendaUso.ToUpper().Contains(param.sSearch.ToUpper()) ||
                                         m.fechaUso.ToUpper().Contains(param.sSearch.ToUpper()));
            }

            //Manejador de orden
            var sortIdx = Convert.ToInt32(Request["iSortCol_0"]);

            var sortDirection = Request["sSortDir_0"];

            if (param.iSortingCols > 0)
            {
                if (sortDirection == "asc")
                {
                    if (sortIdx == 1)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => o.estado);
                    }
                    else if (sortIdx == 5)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => Convert.ToDateTime(o.fechaGen));
                    }
                    else if (sortIdx == 9)
                    {
                        filteredMembers = filteredMembers.OrderBy(o => Convert.ToDateTime(o.fechaUso));
                    }
                }
                else
                {
                    if (sortIdx == 1)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => o.estado);
                    }
                    else if (sortIdx == 5)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToDateTime(o.fechaGen));
                    }
                    else if (sortIdx == 9)
                    {
                        filteredMembers = filteredMembers.OrderByDescending(o => Convert.ToDateTime(o.fechaUso));
                    }
                }
            }
            var displayMembers = filteredMembers
                                 .Skip(param.iDisplayStart)
                                 .Take(param.iDisplayLength);

            var result = from a in displayMembers
                         select new
            {
                a.codigo,
                a.estado,
                a.montoDscto,
                a.impreso,
                a.tiendaGen,
                a.fechaGen,
                a.montoGen,
                a.serieGen,
                a.numeroGen,
                a.tiendaUso,
                a.fechaUso,
                a.montoUso,
                a.serieUso,
                a.numeroUso,
                a.nroReimp,
            };
            var numvariable1 = filteredMembers.Count(n => n.estado.ToUpper() == "CONSUMIDO");
            var numvariable2 = filteredMembers.Count(n => n.estado.ToUpper() == "DISPONIBLE");
            var numvariable3 = filteredMembers.Count(n => n.estado.ToUpper() == "CADUCADO");

            // param.variable1 = lblConsumidos;
            param.variable1 = numvariable1.ToString();
            param.variable2 = numvariable2.ToString();
            param.variable3 = numvariable3.ToString();
            //Se devuelven los resultados por json
            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = totalCount,
                iTotalDisplayRecords = filteredMembers.Count(),
                aaData = result,
                variable1 = param.variable1,
                variable2 = param.variable2,
                variable3 = param.variable3
            }, JsonRequestBehavior.AllowGet));
        }