Beispiel #1
0
        private void BtnVigente_Click(object sender, EventArgs e)
        {
            BLTarifario enlace = new BLTarifario();

            enlace.ActualizarVigenteTarifario(tarifarios[IdTarifarioSelected]);
            this.BtnVigente.Visible = false;
        }
Beispiel #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            BLTarifario enlace = new BLTarifario();
            Tarifario   tar    = new Tarifario();

            tar.Año           = tarifarios[IdTarifarioSelected].Año;
            tar.FechaRegistro = tarifarios[IdTarifarioSelected].FechaRegistro;
            tar.IdData        = tarifarios[IdTarifarioSelected].IdData;
            tar.Vigente       = tarifarios[IdTarifarioSelected].Vigente;
            Dictionary <int, TarifarioDetalle> listado = new Dictionary <int, TarifarioDetalle>();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalSeparator = ".";
            foreach (DataRow row in tablaDataTarifario.Rows)
            {
                TarifarioDetalle det = new TarifarioDetalle();
                det.IdData         = (int)row[0];
                det.IdPaquete      = tarifarios[IdTarifarioSelected].Listado[det.IdData].IdPaquete;
                det.IdTarifarioCab = tarifarios[IdTarifarioSelected].Listado[det.IdData].IdTarifarioCab;
                double es = double.Parse(row[2].ToString(), nfi);
                det.Precio = es;
                listado.Add(det.IdData, det);
            }
            tar.Listado = listado;
            enlace.ActualizarTarifario(tar);
            changeState = false;
            this.CargarDatos();
            this.CargarDatosEnDGVTar();
        }
Beispiel #3
0
        private void CargarDatos()
        {
            isLoading = true;
            BLTarifario enlace = new BLTarifario();

            tarifarios = enlace.ObtenerTarifarios();

            tablaDataTarifario.Rows.Clear();

            if (tarifarios.Count != 0)
            {
                ComboBoxAno.DataSource    = new BindingSource(enlace.ObtenerListadoAno(tarifarios), null);
                ComboBoxAno.DisplayMember = "Value";
                ComboBoxAno.ValueMember   = "Key";

                DGVTar.Enabled      = true;
                ComboBoxAno.Enabled = true;

                HabilBoton(true);
                ModeEditar(false);
                this.CargarDatosEnDGVTar();
            }
            else
            {
                BtnVigente.Visible  = false;
                DGVTar.Enabled      = false;
                ComboBoxAno.Enabled = false;
                HabilBoton(false);
            }
            isLoading = false;
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public void CargarDatos()
        {
            BLTarifario enlace = new BLTarifario();

            OK = enlace.ObtenerListadoAnalisis().Count > 0;

            BtnCrear.Enabled     = OK;
            NumericUDAño.Enabled = OK;
            OK = OK;
            BtnCrear.Visible = OK;
        }
Beispiel #6
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         BLTarifario enlace = new BLTarifario();
         enlace.CopiarTarifario(Tarifarios[(int)ComboBoxAno.SelectedValue], (int)NumericUDAño.Value, CheckBoxVigente.Checked);
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Advertencia");
     }
 }
Beispiel #7
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);
        }
Beispiel #8
0
        private void CargarDatosEnDGVTar()
        {
            BLTarifario enlace = new BLTarifario();

            IdTarifarioSelected = (int)ComboBoxAno.SelectedValue;
            CampRegistro.Text   = tarifarios[IdTarifarioSelected].FechaRegistro.ToShortDateString();
            BtnVigente.Visible  = !tarifarios[IdTarifarioSelected].Vigente;
            foreach (TarifarioDetalle det in tarifarios[IdTarifarioSelected].Listado.Values)
            {
                DataRow row = tablaDataTarifario.NewRow();
                row[0] = det.IdData;
                row[1] = enlace.ObtenerAnalisis(det.IdPaquete).Nombre.ToUpper();
                row[2] = det.Precio.ToString();
                tablaDataTarifario.Rows.Add(row);
            }
        }
Beispiel #9
0
        public void CargarDatos()
        {
            BtnSave.Visible = true;
            BLTarifario enlace = new BLTarifario();

            if (enlace.ObtenerListadoAnalisis().Count > 0 && Tarifarios.Count > 0)
            {
                ComboBoxAno.DataSource    = new BindingSource(enlace.ObtenerListadoAno(Tarifarios), null);
                ComboBoxAno.DisplayMember = "Value";
                ComboBoxAno.ValueMember   = "Key";
                BtnSave.Enabled           = true;
                OK = true;
            }
            else
            {
                OK = false;
                BtnSave.Enabled = false;
            }
        }