public ActionResult Listar(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = MovimientoBL.LstEntradaJGrid(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.MovimientoId,
                            cell = new string[] { 
                                                    item.MovimientoId.ToString(),
                                                    item.Tipo,
                                                    item.TipoMovimientoId.ToString(),
                                                    item.TipoMovimiento,
                                                    item.Fecha.ToString(),
                                                    item.Documento,
                                                    item.Estado,
                                                    item.Observacion
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
            public ActionResult Listar(GridDataRequest request)
            {
                int totalRecords = 0;
                var lstGrd = ArticuloBL.LstListaArticulosJGrid(request, ref totalRecords);

                var productsData = new
                {
                    total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                    page = request.page,
                    records = totalRecords,
                    rows = (from item in lstGrd
                            select new
                            {
                                id = item.ArticuloId,
                                cell = new string[] { 
                                                    item.ArticuloId.ToString(),
                                                    item.ListaPrecioId.ToString(),
                                                    item.TipoArticulo,
                                                    item.ArticuloDesc,
                                                    item.PuntosCanje.ToString(),
                                                    item.Estado.ToString(),
                                                    item.ListaPrecioId.ToString() + "," + (item.Estado ? "1":"0")
                                                }
                            }
                           ).ToArray()
                };
                return Json(productsData, JsonRequestBehavior.AllowGet);
            }
        public ActionResult ListarCliente(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = ClienteBL.LstClienteJGrid(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.ClienteId,
                            cell = new string[] { 
                                                    item.ClienteId.ToString(),
                                                    item.Persona.NombreCompleto,
                                                    item.Persona.TipoDocumento + " " + item.Persona.NumeroDocumento,
                                                    item.Persona.EmailPersonal,
                                                    item.Persona.Celular1,
                                                    item.Persona.Direccion,
                                                    item.Estado.ToString(),
                                                    item.ClienteId.ToString() + "," + (item.Estado ? "1":"0")
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #4
0
 public ActionResult ListarBovedaMovJgrid(GridDataRequest request)
 {
     int totalRecords = 0;
     var lstItem = BovedaBL.LstBovedaMovJGrid(request, ref totalRecords);
     var productsData = new
     {
         total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
         page = request.page,
         records = totalRecords,
         rows = (from item in lstItem
                 select new
                 {
                     id = item.MovimientoBovedaId,
                     cell = new string[] { 
                                             item.MovimientoBovedaId.ToString(),
                                             item.FechaReg.ToString(),
                                             item.CodOperacion,
                                             item.Glosa,
                                             item.Importe.ToString(),
                                             item.MovimientoBovedaId.ToString()
                                         }
                 }
                ).ToArray()
     };
     return Json(productsData, JsonRequestBehavior.AllowGet);
 }
        public ActionResult ListarOrdenesVentaJgrid(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = OrdenVentaBL.LstOrdenesVentaJGrid(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.OrdenVentaId,
                            cell = new string[] { 
                                                    item.OrdenVentaId.ToString(),
                                                    item.FechaReg.ToString(),
                                                    item.Cliente,
                                                    item.TotalDescuento.ToString(),
                                                    item.TotalNeto.ToString(),
                                                    ObtenerTipoOv(item.TipoVenta,item.EstadoCredito),
                                                    ObtenerCondicion(item.Estado,item.TipoVenta),
                                                    item.OrdenVentaId.ToString() + "," + ObtenerEliminarOv(item.Estado,item.TipoVenta,item.EstadoCredito)
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #6
0
        public ActionResult ListarRolJgrid(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = RolBL.LstRolJGrid(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.RolId,
                            cell = new string[] { 
                                                    item.RolId.ToString(),
                                                    item.Denominacion,
                                                    item.Estado.ToString(),
                                                    item.RolId.ToString() + "," + (item.Estado ? "1":"0")
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #7
0
        public ActionResult ListarCajasAsignadas(GridDataRequest request)
        {
            var lstGrd = CajaBL.LstCajaDiarioOficina();

            var productsData = new
            {
                total = (int)Math.Ceiling((float)lstGrd.Count / (float)request.rows),
                page = request.page,
                records = lstGrd.Count,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.CajaDiarioId,
                            cell = new string[] { 
                                                    item.CajaDiarioId.ToString(),
                                                    item.NombreCaja,
                                                    item.IndCierre ? "CERRADO":"ABIERTO",
                                                    item.Cajero,
                                                    item.FechaIniOperacion.ToString(),
                                                    item.FechaFinOperacion.HasValue?item.FechaFinOperacion.Value.ToString():string.Empty,
                                                    item.SaldoInicial.ToString(),
                                                    item.Entradas.ToString(),
                                                    item.Salidas.ToString(),
                                                    item.SaldoFinal.ToString()
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #8
0
 public ActionResult ListarSaldoCajaDiario(GridDataRequest request)
 {
     int totalRecords = 0;
     var lstItem = CajaDiarioBL.LstSaldosCajaDiarioJGrid(request, ref totalRecords);
     var productsData = new
     {
         total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
         page = request.page,
         records = totalRecords,
         rows = (from item in lstItem
                 select new
                 {
                     id = item.CajaDiarioId,
                     cell = new string[] { 
                                             item.CajaDiarioId.ToString(),
                                             item.Caja.Denominacion,
                                             item.Usuario.NombreUsuario,
                                             item.SaldoInicial.ToString(),
                                             item.SaldoFinal.ToString(),
                                             item.FechaIniOperacion.ToString(),
                                             item.FechaFinOperacion.ToString(),
                                             item.IndCierre ? "SI":"NO",
                                             item.TransBoveda ? "SI":"NO",
                                             item.CajaDiarioId.ToString()
                                         }
                 }
                ).ToArray()
     };
     return Json(productsData, JsonRequestBehavior.AllowGet);
 }
        public ActionResult ListarDocs(GridDataRequest request)
        {
            int movimientoid = request.DataFilters().Count > 0 ? int.Parse(request.DataFilters()["MovimientoId"]) : 0;
            if (movimientoid==0)
                return Json(null, JsonRequestBehavior.AllowGet);

            const int totalRecords = 10;
            var productsData = new
            {
                total = 1,page = 1,records = totalRecords,
                rows = (from item in MovimientoDocBL.Listar(x => x.MovimientoId == movimientoid , null, "TipoDocumento,Movimiento")
                        select new
                        {
                            id = item.MovimientoDocId,
                            cell = new string[] { 
                                                    item.MovimientoDocId.ToString(),
                                                    item.TipoDocumento.Denominacion,
                                                    item.SerieDocumento,
                                                    item.NroDocumento,
                                                    item.Movimiento.EstadoId==1?item.MovimientoDocId.ToString():string.Empty
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #10
0
 public ActionResult ListarMovimientosCajaJGrid(GridDataRequest request)
 {
     int totalRecords = 0;
     var lstItem = CajaDiarioBL.LstMovimientosCajaJGrid(request, ref totalRecords);
     var data = new
     {
         total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
         page = request.page,
         records = totalRecords,
         rows = (from item in lstItem
                 select new
                 {
                     id = item.MovimientoCajaId,
                     cell = new string[] { 
                                             item.MovimientoCajaId.ToString(),
                                             item.Estado?item.MovimientoCajaId.ToString():"",
                                             item.CajaDiarioId.ToString(),
                                             item.FechaReg.ToString(),
                                             item.IndEntrada?"ENTRADA":"SALIDA",
                                             item.Persona,
                                             item.Operacion,
                                             item.Descripcion,
                                             item.ImportePago.ToString(),
                                             item.Estado?"ACTIVO":"ANULADO",
                                             item.Estado?item.MovimientoCajaId.ToString():"" 
                                         }
                 }
                ).ToArray()
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Exemple #11
0
 public ActionResult ListarCuotasPendientesJGrid(GridDataRequest request)
 {
     int totalRecords = 0; string totales = string.Empty;
     var lstItem = CajaDiarioBL.LstCuotasPendientesJGrid(request, ref totalRecords, ref totales);
     VendixGlobal<string>.Crear("TotalesCuotasPendientes", totales);
     var data = new
     {
         total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
         page = request.page,
         records = totalRecords,
         rows = (from item in lstItem
                 select new
                 {
                     id = item.PlanPagoId,
                     cell = new string[] { 
                                             item.PlanPagoId.ToString(),
                                             item.Glosa,
                                             item.FechaVencimiento.ToShortDateString(),
                                             item.Amortizacion.ToString(),
                                             item.Interes.ToString(),
                                             item.GastosAdm.ToString(),
                                             item.Cuota.ToString(),
                                             item.DiasAtrazo.ToString(),
                                             item.ImporteMora.ToString(),
                                             item.InteresMora.ToString(),
                                             item.PagoLibre.ToString(),
                                             item.PagoCuota.ToString()
                                         }
                 }
                ).ToArray()
     };
     return Json(data, JsonRequestBehavior.AllowGet);
 }
Exemple #12
0
        public ActionResult ListarCuentasxCobrarJGrid(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstItem = CajaDiarioBL.LstCuentasxCobrarJGrid(request, ref totalRecords);

            var data = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstItem
                        select new
                        {
                            id = item.Id,
                            cell = new string[] { 
                                                    item.OrdenVentaId.ToString(),
                                                    item.CuentaxCobrarId.ToString(),
                                                    item.Oficina,
                                                    ObtenerOp(item.Operacion),
                                                    item.Origen,
                                                    item.Monto.ToString(),
                                                    item.Estado,
                                                    item.FechaReg.ToString()
                                                }
                        }
                       ).ToArray()
            };
            return Json(data, JsonRequestBehavior.AllowGet);
        }
 public void LookForPage(int pageNumber, int resultsPerPage)
 {
     _paging = new GridDataRequest(pageNumber, resultsPerPage, null, true);
 }
Exemple #14
0
        public ActionResult ListarCreditosGrd(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = CreditoBL.ListarCreditosGrd(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.CreditoId,
                            cell = new string[] { 
                                                    item.CreditoId.ToString(),
                                                    item.MontoProducto.ToString(),
                                                    item.MontoInicial.ToString(),
                                                    item.MontoCredito.ToString(),
                                                    item.FormaPago,
                                                    item.NumeroCuotas.ToString(),
                                                    item.Estado
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #15
0
        public ActionResult ListarCargoGrd(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd = CargoBL.ListarCargoJGrid(request, ref totalRecords);

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.CargoId,
                            cell = new string[] { 
                                                    item.CargoId.ToString(),
                                                    item.UsuarioCargo,
                                                    item.TipoCargo,
                                                    item.Importe.ToString(),
                                                    item.Descripcion,
                                                    item.NumCuota.ToString(),
                                                    item.Estado
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #16
0
 public async Task <GridDataResponse> PostPeople([JsonGridDataRequest] GridDataRequest gridDataRequest)
 => gridDataRequest.CreateGridDataResponse((await Person.GetDataAsync().ConfigureAwait(false)).AsQueryable());
Exemple #17
0
        public ActionResult ListarDetalle(GridDataRequest request)
        {
            int movimientoid = request.DataFilters().Count > 0 ? int.Parse(request.DataFilters()["MovimientoId"]) : 0;
            if (movimientoid == 0)
                return Json(null, JsonRequestBehavior.AllowGet);

            const int totalRecords = 10;
            var productsData = new
            {
                total = 1,
                page = 1,
                records = totalRecords,
                rows = (from item in MovimientoBL.ObtenerEntradaDetalle(movimientoid )
                        select new
                        {
                            id = item.MovimientoDetId,
                            cell = new string[] { 
                                                    item.MovimientoDetId.ToString(),
                                                    item.ArticuloId.ToString(),
                                                    item.UnidadMedidaT10.ToString(),
                                                    item.Cantidad.ToString(),
                                                    item.UnidadMedida,
                                                    item.Descripcion,
                                                    item.PrecioUnitario.ToString(),
                                                    item.Descuento.ToString(),
                                                    item.Importe.ToString(),
                                                    item.IndCorrelativo.ToString(),
                                                    item.Elimina?item.MovimientoDetId.ToString():string.Empty
                                                }
                        }
                       ).ToArray()
            };
            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #18
0
        public ActionResult ListarPlanPagoActGrd(GridDataRequest request)
        {
            var lstGrd = CreditoBL.ListarEstadoPlanPago(int.Parse(request.DataFilters()["pCreditoId"]));
            int totalRecords = lstGrd.Count;

            var lstGrdPen = lstGrd.Where(x => x.Estado == "PAG").ToList();
            lstGrd.Add(new usp_EstadoPlanPago_Result()
            {
                PlanPagoId = -1,
                Amortizacion = lstGrdPen.Sum(x => x.Amortizacion),
                Interes = lstGrdPen.Sum(x => x.Interes),
                GastosAdm = lstGrdPen.Sum(x => x.GastosAdm),
                Cuota = lstGrdPen.Sum(x => x.Cuota),
                ImporteMora = lstGrdPen.Sum(x => x.ImporteMora),
                InteresMora = lstGrdPen.Sum(x => x.InteresMora),
                PagoCuota = lstGrdPen.Sum(x => x.PagoCuota)
            });
            lstGrdPen = lstGrd.Where(x => x.Estado == "PEN").ToList();
            lstGrd.Add(new usp_EstadoPlanPago_Result()
            {
                PlanPagoId = -2,
                Amortizacion = lstGrdPen.Sum(x => x.Amortizacion),
                Interes = lstGrdPen.Sum(x => x.Interes),
                GastosAdm = lstGrdPen.Sum(x => x.GastosAdm),
                Cuota = lstGrdPen.Sum(x => x.Cuota),
                ImporteMora = lstGrdPen.Sum(x => x.ImporteMora),
                InteresMora = lstGrdPen.Sum(x => x.InteresMora),
                PagoCuota = lstGrdPen.Sum(x => x.PagoCuota)
            });
            lstGrdPen = lstGrd.Where(x => x.Estado == "PEN" || x.Estado == "PAG" || x.Estado == "CRE").ToList();
            lstGrd.Add(new usp_EstadoPlanPago_Result()
            {
                PlanPagoId = 0,
                Amortizacion = lstGrdPen.Sum(x => x.Amortizacion),
                Interes = lstGrdPen.Sum(x => x.Interes),
                GastosAdm = lstGrdPen.Sum(x => x.GastosAdm),
                Cuota = lstGrdPen.Sum(x => x.Cuota),
                ImporteMora = lstGrdPen.Sum(x => x.ImporteMora),
                InteresMora = lstGrdPen.Sum(x => x.InteresMora),
                PagoCuota = lstGrdPen.Sum(x => x.PagoCuota)
            });

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.PlanPagoId,
                            cell = new string[] { 
                                                   item.PlanPagoId<=0?String.Empty:item.Numero.ToString(),
                                                    item.PlanPagoId<=0?String.Empty:item.Capital.ToString(),
                                                    item.PlanPagoId>0?item.FechaVencimiento.ToShortDateString():(item.PlanPagoId==0?"TOTAL":(item.PlanPagoId==-1?"PAGADO":"PENDIENTE")),
                                                    item.Amortizacion.ToString(),
                                                    item.Interes.ToString(),
                                                    item.GastosAdm.ToString(),
                                                    item.Cuota.ToString(),
                                                    item.DiasAtrazo.ToString(),
                                                    item.ImporteMora.ToString(),
                                                    item.InteresMora.ToString(),
                                                    item.Cargo.ToString(),
                                                    item.PagoLibre.ToString(),
                                                    item.PagoCuota.ToString(),
                                                    item.Estado,
                                                    item.FechaPagoCuota.HasValue?item.FechaPagoCuota.Value.ToShortDateString():string.Empty
                                                }
                        }
                       ).ToArray()
            };

            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
Exemple #19
0
        public ActionResult ListarPlanPagoHistGrd(GridDataRequest request, int pCreditoId)
        {
            var lstGrd = PlanPagoBL.Listar(x => x.CreditoId == pCreditoId);
            int totalRecords = lstGrd.Count;
            lstGrd.Add(new PlanPago()
            {
                PlanPagoId = 0,
                Amortizacion = lstGrd.Sum(x => x.Amortizacion),
                Interes = lstGrd.Sum(x => x.Interes),
                GastosAdm = lstGrd.Sum(x => x.GastosAdm),
                ImporteMora = lstGrd.Sum(x => x.ImporteMora),
                InteresMora = lstGrd.Sum(x => x.InteresMora)
            });

            var productsData = new
            {
                total = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page = request.page,
                records = totalRecords,
                rows = (from item in lstGrd
                        select new
                        {
                            id = item.PlanPagoId,
                            cell = new string[] { 
                                                   item.PlanPagoId==0?String.Empty:item.Numero.ToString(),
                                                    item.PlanPagoId==0?String.Empty:item.Capital.ToString(),
                                                    item.PlanPagoId==0?"TOTAL:":item.FechaVencimiento.ToShortDateString(),
                                                    item.Amortizacion.ToString(),
                                                    item.Interes.ToString(),
                                                    item.GastosAdm.ToString(),
                                                    item.PlanPagoId==0?String.Empty:item.Cuota.ToString(),
                                                    item.ImporteMora.ToString(),
                                                    item.InteresMora.ToString(),
                                                    item.PlanPagoId==0?String.Empty:item.PagoCuota.ToString(),
                                                    item.Estado,
                                                    item.FechaPagoCuota.HasValue?item.FechaPagoCuota.Value.ToShortDateString():string.Empty
                                                }
                        }
                       ).ToArray()
            };

            return Json(productsData, JsonRequestBehavior.AllowGet);
        }
 public IHttpActionResult GetGridData([FromBody] GridDataRequest request)
 {
     return(Ok(request.CreateGridDataResponse(_repository.GetData())));
 }