Beispiel #1
0
        private void REPORTESToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Reportes nuevo = new Reportes();

            nuevo.MdiParent = this;
            nuevo.Show();
        }
Beispiel #2
0
    protected void CrystalReport1_Init(object sender, EventArgs e)
    {
        CrystalReport1 objRpt;

        objRpt = new CrystalReport1();


        String ConnStr = @"Data Source=SQLSRV\TuServidor;Initial Catalog=TuBasedeDatos;Persist Security Info=True;User ID=Tuusuario;Password=Tupassword";

        // LA DE ARRIBA ES NUESTRA CADENA DE CONEXION DEL SERVIDOR

        SqlConnection myConnection = new SqlConnection(ConnStr); // TIENEN QUE UTILIZAR EN EL USING LA CLASE DE System.Data.SqlClient

        String Query = "SELECT * FROM EjemploReportes";          // ESTE ES NUESTRO QUERY

        SqlDataAdapter adapter = new SqlDataAdapter(Query, ConnStr);

        Reportes Ds = new Reportes(); // ESTE ES EL NOMBRE DE NUESTRO DATASET

        adapter.Fill(Ds, "Reportes"); // ESTE Reportes ES EL NOMBRE DE NUESTRA TABLA DE DATOS QUE ESTA DENTRO DE NUESTRO DATASET


        objRpt.SetDataSource(Ds); frmReporte rpt = new frmReporte(); // ES EL FORM DONDE ESTA NUESTRO CRYSTAL REPORT VIEWER
        rpt.crystalReportViewer1.ReportSource = objRpt;              // ESTE ES NUESTRO REPORT VIEWER
        rpt.ShowDialog();                                            // AQUI LO MUESTRA
    }
Beispiel #3
0
        public ActionResult ExportReport(int?id)
        {
            var                  idInvf      = Convert.ToInt32(id);
            ReportDocument       rd          = new ReportDocument();
            Stream               stream      = null;
            ImprimirConciliacion FaltantesRP = new ImprimirConciliacion();
            Reportes             faltantes   = new Reportes();

            var InventarioTableAdapter = new UDV_TBInventarioFisico_ImprimirConciliacionTableAdapter();

            try
            {
                InventarioTableAdapter.Fill(faltantes.UDV_TBInventarioFisico_ImprimirConciliacion, idInvf);

                FaltantesRP.SetDataSource(faltantes);
                stream = FaltantesRP.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);

                FaltantesRP.Close();
                FaltantesRP.Dispose();

                string fileName = "ImprimirConciliacion.pdf";
                Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
                return(File(stream, "application/pdf"));
            }

            catch (Exception Ex)
            {
                Ex.Message.ToString();
                throw;
            }
        }
Beispiel #4
0
        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            Reportes Rep = new Reportes();

            Rep.Show();
        }
Beispiel #5
0
        private void ConformaListaEnumeradoDeReportes()
        {
            List <EnumeradosReporteClass> listaDeEnumeradosClasses = new List <EnumeradosReporteClass>();
            Array descripciones = Enum.GetValues(typeof(Enumerados.Reportes));

            foreach (var descripcion in descripciones)
            {
                var descripcion1 =
                    ((Enumerados.Reportes)(Enum.Parse(typeof(Enumerados.Reportes), descripcion.ToString())))
                    .StringValue();
                var valor = Convert.ToInt32(Enum.Parse(typeof(Enumerados.Reportes), descripcion.ToString()));
                //TODO verificar en la base de datos si no está en la tabla Reportes el que se corresponde
                //TODO al identificador y de no estar insertarlo, de lo contrario mantenerlo
                if (!AGlobalDataContext.Reportes.Any(c => c.IdentificadorReporte == valor))
                {
                    Reportes reporte = new Reportes
                    {
                        Descripcion          = descripcion1,
                        IdentificadorReporte = valor,
                        NombreReporte        = descripcion.ToString()
                    };
                    AGlobalDataContext.Reportes.InsertOnSubmit(reporte);
                    AGlobalDataContext.SubmitChanges();
                }
            }
            reportesBindingSource.DataSource = AGlobalDataContext.Reportes;
        }
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToDateTime(txtfechadesde.Value) > Convert.ToDateTime(txtfechahasta.Value))
                {
                    Response.Write("<script>alert('Fechas Invalidas!');</script>");
                    return;
                }
                if (Convert.ToDateTime(txtfechahasta.Value) < Convert.ToDateTime(txtfechadesde.Value))
                {
                    Response.Write("<script>alert('Fechas Invalidas!');</script>");
                    return;
                }

                NEGReporte conVenta = new NEGReporte();
                Reportes   venta    = new Reportes();

                venta.dFechaDesde = Convert.ToDateTime(txtfechadesde.Value.ToString());
                venta.dFechaHasta = Convert.ToDateTime(txtfechahasta.Value.ToString());

                gvConsultaFactura.DataSource = conVenta.ReporteVenta(venta);
                gvConsultaFactura.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('Error de Sistema. Comuniquese con el administrador'" + ex.Message.ToString() + "</script>");
            }
        }
        private void Button_Sustitutos(object sender, RoutedEventArgs e)
        {
            this.Hide();
            var _window = new Reportes();

            _window.Show();
        }
Beispiel #8
0
        protected void CrearReporte(object sender, EventArgs e)
        {
            try
            {
                obj_reportes = new Reportes(
                    codigo.Text,
                    descr.InnerText,
                    fecha.Text,
                    idOrden
                    );

                if (obj_reportes.insertarReporte(obj_reportes))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('REGISTRO ALMACENADO', '', 'success');", true);
                    fecha.Enabled            = false;
                    descr.EnableViewState    = false;
                    divListaRepuesto.Visible = true;
                    divRepuestos.Visible     = true;
                    LinkButton1.Enabled      = false;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('ERROR AL ALMACENAR', '', 'error');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('OCURRIO UNA EXCEPTION', '', 'error');", true);
            }
        }
Beispiel #9
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,LibroId,NumeroComentario,Motivo")] Reportes reportes)
        {
            if (id != reportes.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reportes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReportesExists(reportes.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(reportes));
        }
Beispiel #10
0
        private void buscarSuicidios()
        {
            try
            {
                DateTime fechaInicio = DateTime.Parse(dpInicio.SelectedDate.ToString());
                DateTime fechaFinal  = DateTime.Parse(dpFinal.SelectedDate.ToString());

                Reportes reportes = new Reportes();
                List <DataGridFallecimientoDatos> resultado = reportes.obtenerSuicidios(idIncidente, fechaInicio, fechaFinal);

                int i = 1;
                dgSuicidio.Items.Clear();
                foreach (var item in resultado)
                {
                    item.cantidad = i.ToString();
                    item.hora     = item.hora + " Hrs.";
                    dgSuicidio.Items.Add(item);
                    i++;
                }
                dgSuicidio.Visibility = Visibility.Visible;
            }
            catch
            {
                MessageBox.Show("Error en la busqueda");
            }
        }
Beispiel #11
0
        private void buscarServicioDeAgua()
        {
            try
            {
                DateTime fechaInicio = DateTime.Parse(dpInicio.SelectedDate.ToString());
                DateTime fechaFinal  = DateTime.Parse(dpFinal.SelectedDate.ToString());

                Reportes reportes = new Reportes();
                List <DataGridServiciosDeAguaDatos> resultado = reportes.obtnerServiciosDeAgua(idIncidente, fechaInicio, fechaFinal);

                int i = 1;
                dgServicosDeAgua.Items.Clear();
                foreach (var item in resultado)
                {
                    item.cantidad = i.ToString();
                    item.hora     = item.hora + " Hrs.";
                    dgServicosDeAgua.Items.Add(item);
                    i++;
                }
                dgServicosDeAgua.Visibility = Visibility.Visible;
            }
            catch
            {
            }
        }
Beispiel #12
0
        private void ReportesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Reportes nuevo = new Reportes();             // Recurso de la dll del navegador

            nuevo.MdiParent = this;
            nuevo.Show();
        }
Beispiel #13
0
        public JsonResult GeneraReportecondicionActual(int puerto)
        {
            var respuesta = new { mensaje = "", html = "" };


            if (puerto == 0)
            {
                respuesta = new { mensaje = "debe seleccionar un puerto", html = "" };
                return(Json(respuesta));
            }
            string reporte3 = "";
            string resp     = "";

            try
            {
                reporte3 = Reportes.Getsituacionactual(puerto);
                // ls_perfiles = UsuarioPerfiles.GetUsuarioPerfil1(id);
                if (reporte3 == "")
                {
                    resp = "Sin Resultados";
                }

                respuesta = new { mensaje = resp, html = reporte3 };

                return(Json(respuesta));
            }
            catch (Exception ex)
            {
                respuesta = new { mensaje = ex.Message.ToString(), html = "" };
                return(Json(respuesta));
            }
        }
        public ActionResult Mostrar()
        {
            Reportes rep = new Reportes();
            //DataTable agotado = rep.ProductosAgotados();
            //DataTable proximo = rep.ProductosProAgotar();
            //string recordatorios = "";

            /*if (agotado.Rows.Count != 0)
             * {
             *  recordatorios = "agotados";
             * }
             * if (proximo.Rows.Count != 0)
             * {
             *  recordatorios += "proximos";
             *
             * }*/
            Tarea tarea = new Tarea();

            string[]  datos  = new string[3];
            string    tabla  = "";
            DataTable tareas = tarea.Tareas(Session["id"].ToString());

            for (int i = 0; i < tareas.Rows.Count; i++)
            {
                string temp = "<li class='todo-list-item'><div class='checkbox'><input onchange='CambiarEstTarea(this.id)' type='checkbox' value=0 id='" + tareas.Rows[i][0] + "'/><label for='checkbox-1'>" + tareas.Rows[i][1] + " - " + tareas.Rows[i][2] + "</label></div></li>";
                tabla += temp;
            }
            return(Json(tabla, JsonRequestBehavior.AllowGet));
        }
Beispiel #15
0
        public DataSet ConvertDataSet(List <Reportes> listReports, DataSet dts)
        {
            Reportes reports = new Reportes();

            dts.Tables.Add();
            string TituloExcel = "#,Tipo,Placa,Fecha Ingreso,Fecha Salida,Hora Ingreso,Hora Salida,Duración,Valor Total,Valor Lavado,Valor Casillero,Valor Total Modificado";

            foreach (var item in TituloExcel.Split(','))
            {
                dts.Tables[0].Columns.Add(item, typeof(string));
            }

            foreach (Reportes record in listReports)
            {
                dts.Tables[0].Rows.Add(
                    record.Contador,
                    record.TipoVehiculo,
                    record.Placa,
                    record.FechaIngreso,
                    record.FechaSalida,
                    record.HoraIngreso,
                    record.HoraSalida,
                    record.TiempoTranscurrido,
                    record.ValorTotal,
                    record.ValorLavado,
                    record.ValorCasillero,
                    record.ValorTotalModificado
                    );
            }
            return(dts);
        }
Beispiel #16
0
        private void ReportesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Reportes ReportesForm = new Reportes();

            ReportesForm.MdiParent = this;
            ReportesForm.Show();
        }
        public ActionResult ExportReportGeneral(tbEntrada tbentrada, string ent_FechaElaboracion)
        {
            var Encargado        = Usuario();
            var EncargadoName    = db.tbUsuario.Where(x => x.usu_Id == Encargado).Select(i => new { i.usu_Nombres, i.usu_Apellidos }).FirstOrDefault();
            var TipoEntrada      = tbentrada.tent_Id;
            var FechaElaboracion = Convert.ToDateTime(ent_FechaElaboracion);
            var estado           = tbentrada.estm_Id;
            var bodega           = tbentrada.bod_Id;

            ReporteTipoEntrada EntradaRV  = new ReporteTipoEntrada();
            ReportDocument     rd         = new ReportDocument();
            Reportes           EntradaDST = new Reportes();

            var EntradaTableAdapter = new UDV_Inv_TipoEntradaTableAdapter();

            try
            {
                EntradaTableAdapter.Fill(EntradaDST.UDV_Inv_TipoEntrada, TipoEntrada, estado, bodega, FechaElaboracion);

                EntradaRV.SetDataSource(EntradaDST);
                EntradaRV.SetParameterValue("usuario", EncargadoName.usu_Nombres + " " + EncargadoName.usu_Apellidos);
                Stream stream = EntradaRV.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);
                EntradaRV.Close();
                EntradaRV.Dispose();
                string fileName = "Entrada_List.pdf";
                Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
                return(File(stream, "application/pdf"));
            }
            catch (Exception Ex)
            {
                Ex.Message.ToString();
                throw;
            }
        }
Beispiel #18
0
        private void btnImprimirCompra_Click(object sender, EventArgs e)
        {
            Reportes re = new Reportes();

            re.IdCompra = Convert.ToInt32(this.dgvTablaCompra.CurrentRow.Cells["Id Compra"].Value);
            re.ShowDialog();
        }
        private void imprimir()
        {
            Page.Session["BUSQUEDA"] = ViewState["BUSQUEDA"];
            Dictionary <string, string> datos = new Dictionary <string, string>();

            datos["IdEmpresa"] = Page.Session["IdEmpresa"].ToString();

            string Reporte = "";

            Reporte = "Ficha_Comercial";

            byte[] archivo = new Reportes {
            }.GenerarReportePosicionCliente(Reporte, datos, "");
            if (archivo != null)
            {
                Page.Session["tipoDoc"]    = "pdf";
                Page.Session["binaryData"] = archivo;
                Page.Session["Titulo"]     = Reporte;
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('BajarDocumento.aspx','_blank')", true);
            }
            else
            {
                dvWarning.Style.Add("display", "block");
                lbWarning.Text = string.Format("Revise los siguientes datos: {0}{1}{0}{2}", "<br />", " Tabla Direcciones (debe existir al menos una direccion principal)", " Tabla Personas (debe existir al menos un contacto principal)");
            }
        }
        private void btnMostrarReporte_Click(object sender, EventArgs e)
        {
            DataSet ds = new Reportes().INSTITUCION((int)cboAnio.SelectedItem);

            dgvReporte.DataSource = null;
            dgvReporte.DataSource = ds.Tables[0];
        }
Beispiel #21
0
        private void btnMembresia_Click(object sender, EventArgs e)
        {
            Form formEspera = new FormEspera();

            formEspera.Show();
            try
            {
                Queries.transactionBegin();

                AportacionDetalle detalle = new AportacionDetalle(asociado, "Abono inicial", asociado.fechaIngreso, 10);
                detalle.insert();

                Reportes.comprobanteAportacion(asociado, detalle);
                formEspera.Close();
                Reportes.abrirCarpeta();


                Queries.transactionCommit();
            }
            catch (Exception ex)
            {
                formEspera.Close();
                Queries.transactionRollback();
            }
        }
Beispiel #22
0
        public ActionResult Reporte(tbObjeto Objeto)
        {
            int            iTipoReporte      = Objeto.obj_Id;
            ReportDocument rd                = new ReportDocument();
            Stream         stream            = null;
            CuponDescuento CuponRV           = new CuponDescuento();
            Reportes       CuponDescuentoDST = new Reportes();

            var CuponTableAdapter = new UDV_Vent_CuponDescuentoPorFechaTableAdapter();

            try
            {
                CuponTableAdapter.FillFiltros(CuponDescuentoDST.UDV_Vent_CuponDescuentoPorFecha, "2019-01-18", "2019-01-18");

                CuponRV.SetDataSource(CuponDescuentoDST);
                stream = CuponRV.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);

                CuponRV.Close();
                CuponRV.Dispose();

                string fileName = "cupon_descuento.pdf";
                Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
                return(File(stream, "application/pdf"));
            }
            catch (Exception Ex)
            {
                Ex.Message.ToString();
                throw;
            }
        }
Beispiel #23
0
        private void buscarMaternidad()
        {
            try
            {
                DateTime fechaInicio = DateTime.Parse(dpInicio.SelectedDate.ToString());
                DateTime fechaFinal  = DateTime.Parse(dpFinal.SelectedDate.ToString());

                Reportes reportes = new Reportes();
                List <DataGridMaternidadDatos> resultado = reportes.obtenerMaternidad(idIncidente, fechaInicio, fechaFinal);


                dgMaternidad.Items.Clear();

                foreach (var item in resultado)
                {
                    item.cantidad  = "1";
                    item.vivo      = item.fallecido == "False" ? "x" : item.fallecido == null?"x": " ";
                    item.fallecido = item.fallecido == "True" ? "x" : " ";
                    item.hora      = item.hora + " Hrs.";
                    dgMaternidad.Items.Add(item);
                }
                dgMaternidad.Visibility = Visibility.Visible;
            }
            catch
            {
                MessageBox.Show("Error en la busqueda");
            }
        }
Beispiel #24
0
        protected void btnConsulta_Click(object sender, EventArgs e)
        {
            Reportes        reportes        = new Reportes();
            NegocioCuenta   negocioCuenta   = new NegocioCuenta();
            NegocioEmpleado negocioEmpleado = new NegocioEmpleado();
            int             id = negocioEmpleado.retornarDepartamentoByRut(negocioEmpleado.retornarRutByCuentaID(negocioCuenta.retornarID(Session["usuario"].ToString())));

            foreach (var item in reportes.reportePorTipoPermisoDeUnidadInterna(id))
            {
                TableRow  tableRow     = new TableRow();
                TableCell nombreUnidad = new TableCell();
                TableCell tipoPermiso  = new TableCell();
                TableCell cantidad     = new TableCell();
                tablaEstadoPermisos.Rows.Add(tableRow);
                nombreUnidad.Text = item.nombreUnidad;
                tipoPermiso.Text  = item.nombreTipoPermiso;
                cantidad.Text     = item.cantidadPermisos.ToString();

                tableRow.Cells.Add(nombreUnidad);
                tableRow.Cells.Add(tipoPermiso);
                tableRow.Cells.Add(cantidad);
            }

            this.containerTabla.Attributes.Remove("hidden");
        }
Beispiel #25
0
        private void buscarComunes(int idIncidente)
        {
            try
            {
                DateTime fechaInicio = DateTime.Parse(dpInicio.SelectedDate.ToString());
                DateTime fechaFinal  = DateTime.Parse(dpFinal.SelectedDate.ToString());

                Reportes reportes = new Reportes();
                List <DataGridComunDatos> resultado = reportes.obtenerReproteComunes(idIncidente, fechaInicio, fechaFinal);

                int i = 1;
                dgComun.Items.Clear();
                foreach (var item in resultado)
                {
                    item.Cantidad  = i.ToString();
                    item.Fallecido = item.Fallecido == "True" ? "x" : " ";
                    item.Vivo      = item.Vivo == "True" ? "x" : " ";
                    item.Hora      = item.Hora + " Hrs.";
                    dgComun.Items.Add(item);
                    i++;
                }
                dgComun.Visibility = Visibility.Visible;
            }
            catch
            {
                MessageBox.Show("Error en la busqueda");
            }
        }
        private void changeview(string vista)
        {
            UserControl PrecioPanel       = new Precios();
            UserControl ReportePanel      = new Reportes();
            UserControl VentasPanel       = new Ventas();
            UserControl EstadisticasPanel = new Estadisticas();

            ContenedorGerente.Controls.Clear();
            switch (vista)
            {
            case "Precios":
                ContenedorGerente.Controls.Add(PrecioPanel);
                PrecioPanel.Dock = DockStyle.Fill;
                break;

            case "Reportes":
                ContenedorGerente.Controls.Add(ReportePanel);
                ReportePanel.Dock = DockStyle.Fill;
                break;

            case "Ventas":
                ContenedorGerente.Controls.Add(VentasPanel);
                VentasPanel.Dock = DockStyle.Fill;
                break;

            case "Estadisticas":
                ContenedorGerente.Controls.Add(EstadisticasPanel);
                EstadisticasPanel.Dock = DockStyle.Fill;
                break;
            }
        }
        //para imprimir entrada por id
        public ActionResult ExportReport(int?id)
        {
            var Encargado     = Usuario();
            var EncargadoName = db.tbUsuario.Where(x => x.usu_Id == Encargado).Select(i => new { i.usu_Nombres, i.usu_Apellidos }).FirstOrDefault();
            var ent_id        = Convert.ToInt32(id);
            ImprimirEntradaPorId EntradaRVId  = new ImprimirEntradaPorId();
            ReportDocument       rdId         = new ReportDocument();
            Reportes             EntradaDSTId = new Reportes();

            var EntradaTableAdapterId = new UDV_Inv_EntradaPorIdTableAdapter();

            try
            {
                EntradaTableAdapterId.Fill(EntradaDSTId.UDV_Inv_EntradaPorId, ent_id);

                EntradaRVId.SetDataSource(EntradaDSTId);
                EntradaRVId.SetParameterValue("usuario", EncargadoName.usu_Nombres + " " + EncargadoName.usu_Apellidos);
                Stream stream = EntradaRVId.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);
                EntradaRVId.Close();
                EntradaRVId.Dispose();
                string fileName = "ImprimirEntrada.pdf";
                Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
                return(File(stream, "application/pdf"));
            }
            catch
            {
                throw;
            }
        }
Beispiel #28
0
        public ActionResult GenerarReporte(int pscat_Id)
        {
            ReportDocument   rd          = new ReportDocument();
            Stream           stream      = null;
            CatalogoProducto ProductoRV  = new CatalogoProducto();
            Reportes         ProductoDST = new Reportes();

            var ProductoTableAdapter = new UDV_Inv_CatalogoProductosTableAdapter();

            try
            {
                ProductoTableAdapter.Fill(ProductoDST.UDV_Inv_CatalogoProductos, pscat_Id);

                ProductoRV.SetDataSource(ProductoDST);
                stream = ProductoRV.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                stream.Seek(0, SeekOrigin.Begin);

                ProductoRV.Close();
                ProductoRV.Dispose();

                string fileName = "CatalogoProducto.pdf";
                Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
                return(File(stream, "application/pdf"));
            }
            catch (Exception Ex)
            {
                Ex.Message.ToString();
                throw;
            }
        }
Beispiel #29
0
        public List <Reportes> ReporteCitasPorEstado(int SucursalId, int estadocita)
        {
            List <Reportes> CitasList = new List <Reportes>();

            try
            {
                SqlCommand cmd = CrearComando("SGRC_SP_Citas_GetByEstado");
                cmd.Parameters.AddWithValue("@sucursalid", SucursalId);
                cmd.Parameters.AddWithValue("@estadocita", estadocita);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                AbrirConexion();
                da.Fill(dt);
                CerrarConexion();
                CitasList = (from DataRow dr in dt.Rows
                             select new Reportes()
                {
                    CitaId = Convert.ToInt32(dr["CitaId"]),
                    CitaIdentificacion = Convert.ToString(dr["CitaIdentificacion"]),
                    CitaFecha = Convert.ToString(dr["CitaFecha"]),
                    CitaNombre = Convert.ToString(dr["CitaNombre"]),
                    CitaCorreoElectronico = Convert.ToString(dr["CitaCorreoElectronico"]),
                    CitaTelefonoCelular = Convert.ToString(dr["CitaTelefonoCelular"]),
                    CitaHora = Convert.ToString(dr["CitaHora"]),
                    CitaHoraInicioCompleta = Convert.ToString(dr["CitaHoraInicioCompleta"]),
                    CitaHoraFinCompleta = Convert.ToString(dr["CitaHoraFinCompleta"]),
                    tramite = Convert.ToString(dr["tramite"]),
                    PosicionId = Convert.ToString(dr["PosicionId"]),
                    posicionDescripcion = Convert.ToString(dr["posicionDescripcion"]),
                    CitaCuenta = Convert.ToString(dr["CitaCuenta"]),
                    CitaTicket = Convert.ToString(dr["CitaTicket"]),
                    segmento = Convert.ToString(dr["segmento"]),
                    sucursal = Convert.ToString(dr["sucursal"]),
                    estado = Convert.ToString(dr["estado"]),
                    CitaHoraClienteIniciaAtencion = Convert.ToString(dr["CitaHoraClienteIniciaAtencion"]),
                    CitaHoraClienteSaleAtencion = Convert.ToString(dr["CitaHoraClienteSaleAtencion"]),
                    TiempoEnCita = Convert.ToInt32(dr["tiempo_en_cita"]),
                    TiempoEspera = Convert.ToInt32(dr["tiempo_espera"]),
                    Accion = 1,
                    Mensaje = "Se cargó correctamente la información de las citas."
                }).ToList();
                if (CitasList.Count == 0)
                {
                    Reportes ss = new Reportes();
                    ss.Accion  = 0;
                    ss.Mensaje = "No se encontraron registros!";
                    CitasList.Add(ss);
                }
            }
            catch (Exception ex)
            {
                Reportes oCita = new Reportes();
                oCita.Accion  = 0;
                oCita.Mensaje = ex.Message.ToString();
                CitasList.Add(oCita);
                throw new Exception("Error Obteniendo todos los registros " + ex.Message, ex);
            }
            return(CitasList);
        }
Beispiel #30
0
        public ActionResult DeleteConfirmed(int id)
        {
            Reportes reportes = db.Reportes.Find(id);

            db.Reportes.Remove(reportes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private void RenderReport(Reportes.Valores_anio_equipo ds)
        {
            ReportViewer viewer = new ReportViewer();
            viewer.ProcessingMode = ProcessingMode.Local;
            viewer.LocalReport.EnableExternalImages = true;
            viewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource);

            viewer.LocalReport.ReportPath = Server.MapPath("~/Aplicativo/Reportes/Valores_anio_equipo_categoria.rdlc");

            ReportDataSource equipo = new ReportDataSource("Equipo", ds.Datos_equipo.Rows);
            ReportDataSource detalle = new ReportDataSource("Equipos", ds.Equipos.Rows);

            viewer.LocalReport.DataSources.Add(equipo);
            viewer.LocalReport.DataSources.Add(detalle);

            Microsoft.Reporting.WebForms.Warning[] warnings = null;
            string[] streamids = null;
            string mimeType = null;
            string encoding = null;
            string extension = null;
            string deviceInfo = null;
            byte[] bytes = null;

            deviceInfo = "<DeviceInfo><SimplePageHeaders>True</SimplePageHeaders></DeviceInfo>";

            //Render the report
            bytes = viewer.LocalReport.Render("PDF", deviceInfo, out  mimeType, out encoding, out extension, out streamids, out warnings);
            Session["Reporte"] = bytes;

            string script = "<script type='text/javascript'>window.open('Reportes/Report.aspx');</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "VentanaPadre", script);
        }
 public BuscarTiendaViewModel(IWindowManager windowmanager, Reportes.reporteServiciosViewModel reporteServiciosViewModel, int ventanaAccion)
     : this(windowmanager)
 {
     uSQL = new UbigeoSQL();
     CmbDpto = uSQL.BuscarDpto();
     deft = new Ubigeo();
     deft.Nombre = "TODOS";
     CmbDpto.Insert(0, deft);
     Index1 = 0;
     this.reporteServiciosViewModel = reporteServiciosViewModel;
     this.ventanaAccion = ventanaAccion;
 }
Beispiel #33
0
        private void Generar(Conexion Datos, string reporte, Reportes report)
        {
            reportDocument = new ReportDocument();

            string sql = null;

            switch (report)
            {
                case Reportes.Lps:
                    sql = "usp_lps_reporte ";
                    sql += IdLpsEmpleado.ToString();
                    sql += ", " + IdEmpresa;
                    break;
                case Reportes.Acumulados:
                    sql = "usp_lps_acumulados_porIdEmpleado ";
                    sql += IdEmpleado.ToString();
                    break;
            }
            reportDocument.Load(reporte);
            reportDocument.SetDataSource(Datos.ExecuteReaderConTransaccion(sql).Tables[0]);
            reportDocument.DataSourceConnections[0].SetConnection("192.168.16.252", "siser_v3", "sa", "Acceso2013");

            switch (report)
            {
                case Reportes.Lps:
                    Reporte = (MemoryStream)reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                    break;
                case Reportes.Acumulados:
                    Acumulados = (MemoryStream)reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                    break;
            }

            try
            {
                reportDocument.Dispose();
                reportDocument = null;
                reportDocument.Close();
            }
            catch
            {
            }
        }
 public ProductoBuscarViewModel(Reportes.reporteStockViewModel reporteStockViewModel, int ventanaAccion)
 {
     this.reporteStockViewModel = reporteStockViewModel;
     LineaProductoSQL lpSQL = new LineaProductoSQL();
     LstLineasProducto = lpSQL.ObtenerLineasProducto();
     this.ventanaAccion = ventanaAccion;
 }
Beispiel #35
0
        public ActionResult Index()
        {
            HORA primera = db.HORA.Find(1);
            DateTime hora = primera.HORAGUARDADA;
            DateTime horaahora = DateTime.Now;
            TimeSpan final = horaahora - hora;
            TimeSpan span = TimeSpan.FromHours(24);

            if (final > span)
            {
                if (DayOfWeek.Saturday == horaahora.DayOfWeek || DayOfWeek.Sunday == horaahora.DayOfWeek)
                {
                }
                else
                {
                    Reportes _Reportes = new Reportes();
                    _Reportes.reporteparatodos();
                    HORA guardar = db.HORA.Find(1);
                    guardar.HORAGUARDADA = horaahora;
                    db.Entry(guardar).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }

            HORA segunda = db.HORA.Find(2);
            DateTime hora2 = segunda.HORAGUARDADA;
            TimeSpan final2 = horaahora - hora2;
            TimeSpan span2 = TimeSpan.FromDays(2);

            if (final2 > span2)
            {
                //verificar(horaahora);
                HORA guardar = db.HORA.Find(2);
                guardar.HORAGUARDADA = horaahora;
                db.Entry(guardar).State = EntityState.Modified;
                db.SaveChanges();
            }

            ViewBag.Message = "ASP.NET MVC";
            tipusu();

            return View();
        }