Exemplo n.º 1
0
        private System.Data.DataTable ObtenerTablaFormatoDatosReporteEconomicoMedico(int ano, int mes, int idMedico)
        {
            BLTarifario enlace = new BLTarifario();
            Tarifario   tar    = enlace.ObtenerTarifario();

            System.Data.DataTable tablaInterna = new System.Data.DataTable();
            try
            {
                LogicaOrden enlaceOrden   = new LogicaOrden();
                List <int>  codigosExamen = new List <int>();


                Dictionary <int, Dictionary <int, int> > reporteAcumulado = enlaceOrden.ObtenerReporteAcumuladoMensual(ano, mes, idMedico);

                Dictionary <int, Dictionary <int, int> > reporteCantidad = enlaceOrden.ObtenerReporteCantidadMensual(ano, mes, idMedico);

                tablaInterna.Columns.Add("id", typeof(int));
                tablaInterna.Columns.Add("nombre", typeof(string));
                tablaInterna.Columns.Add("nroP", typeof(int));
                tablaInterna.Columns.Add("acuP", typeof(int));
                tablaInterna.Columns.Add("nroS", typeof(int));
                tablaInterna.Columns.Add("acuS", typeof(int));
                tablaInterna.Columns.Add("nroE", typeof(int));
                tablaInterna.Columns.Add("acuE", typeof(int));
                tablaInterna.Columns.Add("precioUn", typeof(double));
                tablaInterna.Columns.Add("totalMes", typeof(double));
                tablaInterna.Columns.Add("cob", typeof(int));

                foreach (int idAnalisis in ListaAnalisis.GetInstance().Coleccion.Keys)
                {
                    DataRow row = tablaInterna.NewRow();

                    row[0] = idAnalisis;
                    row[1] = ListaAnalisis.GetInstance().Analisis[idAnalisis].Nombre;

                    row[2] = (existDataInDictionary(idAnalisis, reporteCantidad[0]) ? reporteCantidad[0][idAnalisis] : 0);   //contador P
                    row[3] = (existDataInDictionary(idAnalisis, reporteAcumulado[0]) ? reporteAcumulado[0][idAnalisis] : 0); //acumulador P

                    row[4] = (existDataInDictionary(idAnalisis, reporteCantidad[1]) ? reporteCantidad[1][idAnalisis] : 0);   // Contador S
                    row[5] = (existDataInDictionary(idAnalisis, reporteAcumulado[1]) ? reporteAcumulado[1][idAnalisis] : 0); //acumulador S

                    row[6] = (existDataInDictionary(idAnalisis, reporteCantidad[2]) ? reporteCantidad[2][idAnalisis] : 0);   //Contador Ex
                    row[7] = (existDataInDictionary(idAnalisis, reporteAcumulado[2]) ? reporteAcumulado[2][idAnalisis] : 0); //acumulador Ex

                    row[8] = enlace.ObtenerTarifarioDetalle(tar, idAnalisis).Precio;
                    row[9] = (int)row[2] * enlace.ObtenerTarifarioDetalle(tar, idAnalisis).Precio;


                    row[10] = (int)row[2] + (int)row[4] + (int)row[6] + (int)row[3] + (int)row[5] + (int)row[7];

                    tablaInterna.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(tablaInterna);
        }
Exemplo n.º 2
0
        private System.Data.DataTable ObtenerTablaFormatoDatosReporteResultado(int ano, int mes)
        {
            BLTarifario enlace = new BLTarifario();
            Tarifario   tar    = enlace.ObtenerTarifario();

            System.Data.DataTable tablaInterna = new System.Data.DataTable();
            try
            {
                LogicaOrden     enlaceOrden = new LogicaOrden();
                List <object[]> resultados  = enlaceOrden.ObtenerReporteResultado(ano, mes);

                tablaInterna.Columns.Add("dni", typeof(string));
                tablaInterna.Columns.Add("nombre", typeof(string));
                tablaInterna.Columns.Add("apellido1", typeof(string));
                tablaInterna.Columns.Add("apellido2", typeof(string));
                tablaInterna.Columns.Add("edad", typeof(double));
                tablaInterna.Columns.Add("sexo", typeof(string));
                tablaInterna.Columns.Add("gestante", typeof(string));
                tablaInterna.Columns.Add("Examen", typeof(string));
                tablaInterna.Columns.Add("respuesta", typeof(string));
                tablaInterna.Columns.Add("nota", typeof(string));
                tablaInterna.Columns.Add("cobertura", typeof(string));
                tablaInterna.Columns.Add("estado", typeof(string));

                foreach (object[] obt in resultados)
                {
                    DataRow row = tablaInterna.NewRow();
                    row[0]  = obt[1].ToString();
                    row[1]  = obt[2].ToString();
                    row[2]  = obt[3].ToString();
                    row[3]  = obt[4].ToString();
                    row[4]  = obt[5];
                    row[5]  = DiccionarioGeneral.GetInstance().TipoSexo[(int)obt[6]];
                    row[6]  = Convert.ToBoolean(obt[7])?"SI":"NO";
                    row[7]  = Plantillas.GetInstance().GetPlantilla((int)obt[0]).Nombre;
                    row[8]  = obt[8].ToString().Replace('.', ',');
                    row[9]  = obt[9];
                    row[10] = DiccionarioGeneral.GetInstance().TipoCobertura[(int)obt[10]];
                    row[11] = DiccionarioGeneral.GetInstance().EstadoExamen[(int)obt[11]];

                    tablaInterna.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(tablaInterna);
        }