コード例 #1
0
        public List<Reporte> ListarReportes()
        {
            List<Reporte> list = new List<Reporte>();
            try
            {
                this.JsonParam = "{\"indice\":8}";
                String result = netclient.NetPost("ws-reportes.php", this.JsonParam);
                var jobject = JObject.Parse(result);
                var token = jobject.SelectToken("reportes").ToList();

                foreach (var item in token)
                {
                    //{"rut":"17231233","dv":"2","nombre":"Ada","appPaterno":"Tatus","appMaterno":"Boren","idReporte":2,"fechaCreacion":"2013-10-24","tipoReporte":"Reporte Alumno"}
                    Reporte reporte = new Reporte();
                    reporte.Rut = Convert.ToInt32(item.SelectToken("rut").ToString());
                    reporte.Dv = item.SelectToken("dv").ToString();
                    reporte.Nombre = item.SelectToken("nombre").ToString();
                    reporte.ApellidoPaterno = item.SelectToken("appPaterno").ToString();
                    reporte.ApellidoMaterno = item.SelectToken("appMaterno").ToString();
                    reporte.IdReporte = Convert.ToInt32(item.SelectToken("idReporte").ToString());
                    reporte.FechaCreacion = Convert.ToDateTime(item.SelectToken("fechaCreacion").ToString());
                    reporte.TipoReporte = item.SelectToken("tipoReporte").ToString();
                    list.Add(reporte);
                }

            }
            catch (Exception e)
            {
                throw new Exception(e + "| Error al Listar Reportes");
            }
            return list;
        }
コード例 #2
0
 public string IngresarReporte(Reporte repo)
 {
     ////report.Query = fecha_inicio+","+fecha_termino;
     string reporteInsertado;
     string fechacreacion = repo.FechaCreacion.Year + "-" + repo.FechaCreacion.Month + "-" + repo.FechaCreacion.Day;
     repo.Query = repo.Fecha_inicio.Year + "-" + repo.Fecha_inicio.Month + "-" + repo.Fecha_inicio.Day + "," + repo.Fecha_termino.Year + "-" + repo.Fecha_termino.Month + "-" + repo.Fecha_termino.Day;
      //{"indice":11,"idPersona":2,"fechaCreacion":"12-12-2012","tipoReporte":"monetario","consultaReporte":"select * from abono"}
     this.JsonParam = "{\"indice\":12,\"idPersona\":" + repo.IdPersona + ",\"fechaCreacion\":\"" + fechacreacion + "\",\"tipoReporte\":\"" + repo.TipoReporte + "\",\"consultaReporte\":\"" + repo.Query + "\"}";
     try
     {
         String result = netclient.NetPost("ws-reportes.php", this.JsonParam);
         var jobject = JObject.Parse(result);
         reporteInsertado = jobject.SelectToken("reporteID").ToString();
     }
     catch (Exception e)
     {
         throw new Exception(e + "| Error al insertar Gastos");
     }
    return reporteInsertado;
 }
コード例 #3
0
        private void btnGeneraReporte_Click(object sender, EventArgs e)
        {
            MessageBox.Show("El sistema sfh está generando su reporte", "SFH Administración de Reportes y Estadísticas - Reportes Monetarios", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DateTime fecha_inicio = Convert.ToDateTime(this.cmbxDesdeFecha.Text.ToString());
            DateTime fecha_termino = Convert.ToDateTime(this.cmbxHastaFecha.Text.ToString());
            this.list_abns = this.client_data.ListarAbonosporFechas(fecha_inicio, fecha_termino);

            if (list_abns.Count.Equals(0))
            {
                MessageBox.Show("Esta operación no ha arrojado resultados", "SFH Administración de Reportes y Estadísticas - Reportes Monetarios", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                this.list_gastos = this.client_data.ListarGastosporFechas(fecha_inicio, fecha_termino);
                Reporte report = new Reporte();
                report.IdPersona = this.id_usuario;
                report.FechaCreacion = DateTime.Now;
                report.TipoReporte = "Reporte Monetario";
                report.Fecha_inicio = fecha_inicio;
                report.Fecha_termino = fecha_termino;
                
                if (this.client_repo.IngresarReporte(report) != "")
                {
                    if (list_gastos.Count > 0)
                    {
                        this.GenerarReporte(list_abns, list_gastos, fecha_inicio, fecha_termino);
                    }
                }
            }
            this.LimpiarControles();
        }
コード例 #4
0
        public List<Reporte> ListarReportesFechasNuevaAnt()
        {
            List<Reporte> list = new List<Reporte>();
            try
            {
                this.JsonParam = "{\"indice\":11}";
                String result = netclient.NetPost("ws-reportes.php", this.JsonParam);
                var jobject = JObject.Parse(result);
                var token = jobject.SelectToken("reportes").ToList();

                foreach (var item in token)
                {
                    Reporte repo = new Reporte();
                    //,{"idReporte":1,"fechaCreacion":"2013-09-10"}
                    repo.IdReporte = Convert.ToInt32(item.SelectToken("idReporte").ToString());
                    repo.FechaCreacion = Convert.ToDateTime(item.SelectToken("fechaCreacion").ToString());
                    list.Add(repo);
                }

            }
            catch (Exception e)
            {
                throw new Exception(e + "| Error al Listar Reportes");
            }
            return list;
        }
コード例 #5
0
 public frmGenerarReportesPacientes(Reporte reporte)
 {
     InitializeComponent();
     this.reporte = reporte;
 }