Beispiel #1
0
        private Condicion valorCondicionActual()
        {
            if (tipoCondicionActual() == Tipo.SinCondicion)
            {
                return(null);
            }
            else
            {
                double ValorEsperado2 = double.NaN;

                if ((Operador)CB_cond1.SelectedItem == Operador.entre)
                {
                    ValorEsperado2 = Metodos.validarYConvertirADouble(TB_Cond2.Text);
                }
                Condicion condicion = Condicion.crear((Tipo)LB_Condiciones.SelectedItem, (Operador)CB_cond1.SelectedItem, Metodos.validarYConvertirADouble(TB_Cond1.Text), ValorEsperado2);
                return(condicion);
            }
        }
Beispiel #2
0
 public void editar(ComboBox CB_Estructura, TextBox TB_nombresAlt, ComboBox CB_TipoRestr, TextBox TB_valorCorrespondiente,
                    ComboBox CB_UnidadesCorresp, ComboBox CB_EsMenorQue, TextBox TB_ValorEsperado, TextBox TB_ValorTolerado, ComboBox CB_UnidadesValor, TextBox TB_nota)
 {
     CB_Estructura.Text = estructura.nombre;
     for (int i = 1; i < estructura.nombresPosibles.Count; i++)
     {
         TB_nombresAlt.Text += "\r\n" + estructura.nombresPosibles[i];
     }
     CB_TipoRestr.SelectedIndex = 2; //cambiar en cada restriccion
     //TB_valorCorrespondiente.Text = Metodos.validarYConvertirAString(valorCorrespondiente);
     if (esMenorQue)
     {
         CB_EsMenorQue.SelectedIndex = 0;
     }
     else
     {
         CB_EsMenorQue.SelectedIndex = 1;
     }
     TB_ValorEsperado.Text           = Metodos.validarYConvertirAString(valorEsperado);
     TB_ValorTolerado.Text           = Metodos.validarYConvertirAString(valorTolerado);
     CB_UnidadesValor.SelectedItem   = unidadValor;
     CB_UnidadesCorresp.SelectedItem = unidadCorrespondiente;
     TB_nota.Text = nota;
 }
Beispiel #3
0
        private void BT_Aceptar_Click(object sender, EventArgs e)
        {
            double aux = 0;

            if (salidaDouble)
            {
                aux = Metodos.validarYConvertirADouble(TB_Llenar.Text);
            }
            salida = TB_Llenar.Text;
            if (!Double.IsNaN(aux))
            {
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                TB_Llenar.SelectAll();
            }
            if (!esPasword)
            {
                DialogResult = DialogResult.OK;
                Close();
            }
            else if (esPasword && password == TB_Llenar.Text)
            {
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                MessageBox.Show("La contraseña ingresada es incorrecta");
                DialogResult = DialogResult.None;
                TB_Llenar.Focus();
                TB_Llenar.SelectAll();
            }
        }
Beispiel #4
0
 private void habilitarBotones()
 {
     if (hayContext)
     {
         BT_Nueva.Enabled          = false;
         BT_Editar.Enabled         = false;
         BT_Ver.Enabled            = false;
         BT_Duplicar.Enabled       = false;
         BT_Eliminar.Enabled       = false;
         BT_AplicarAUnPlan.Enabled = true;
         BT_AplicarPorLote.Enabled = false;
     }
     else
     {
         Metodos.habilitarBoton(editaPlantilla, BT_Nueva);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count == 1 && editaPlantilla, BT_Editar);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count == 1 && editaPlantilla, BT_Duplicar);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count == 1, BT_Ver);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count > 0 && editaPlantilla, BT_Eliminar);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count == 1 && !((Plantilla)LB_Plantillas.SelectedItems[0]).esParaExtraccion, BT_AplicarAUnPlan);
         Metodos.habilitarBoton(LB_Plantillas.SelectedItems.Count == 1, BT_AplicarPorLote);
         Metodos.habilitarBoton(editaPlantilla, BT_Configuracion);
     }
 }
Beispiel #5
0
 private void DGV_Análisis_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
 {
     BT_GuardarPaciente.Enabled = true;
     Metodos.habilitarBoton(DGV_Análisis.ColumnCount > 1, BT_Exportar);
 }
Beispiel #6
0
 private void DGV_Estructuras_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     Metodos.habilitarBoton(LB_Planes.SelectedItems.Count == 1 && DGV_Estructuras.RowCount > 0, BT_Analizar);
 }
Beispiel #7
0
 private void LB_Planes_SelectedIndexChanged(object sender, EventArgs e)
 {
     Metodos.habilitarBoton(LB_Planes.SelectedItems.Count == 1, BT_SeleccionarPlan);
 }
Beispiel #8
0
 private void TB_ID_TextChanged(object sender, EventArgs e)
 {
     Metodos.habilitarBoton(!string.IsNullOrEmpty(TB_ID.Text), BT_AbrirPaciente);
 }
Beispiel #9
0
        private void DGV_Análisis_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                FormTB formTb = new FormTB((senderGrid.Rows[e.RowIndex].Cells[e.ColumnIndex]).Value.ToString(), true);
                formTb.Text = "Volumen dosis maxima";
                formTb.Controls.OfType <Label>().FirstOrDefault().Text = "Definir el tamaño del elemento de volumen para el \ncálculo de la dosis máxima [cm3]";
                formTb.ShowDialog();

                if (formTb.DialogResult == DialogResult.OK)
                {
                    ((RestriccionDosisMax)(plantilla.listaRestricciones[e.RowIndex])).analizarPlanEstructura(planSeleccionado(), estructuraCorrespondiente(plantilla.listaRestricciones[e.RowIndex].estructura.nombre), Metodos.validarYConvertirADouble(formTb.salida));
                    DGV_Análisis.Rows[e.RowIndex].Cells[2].Value = plantilla.listaRestricciones[e.RowIndex].valorMedido + plantilla.listaRestricciones[e.RowIndex].unidadValor;
                    colorCelda(DGV_Análisis.Rows[e.RowIndex].Cells[2], plantilla.listaRestricciones[e.RowIndex].cumple());
                    (senderGrid.Rows[e.RowIndex].Cells[e.ColumnIndex]).Value = formTb.salida;
                }
            }
        }
Beispiel #10
0
 private void DGV_Análisis_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     Metodos.habilitarBoton(DGV_Análisis.Rows.Count > 0, BT_GuardarReporte);
     Metodos.habilitarBoton(DGV_Análisis.Rows.Count > 0, BT_Imprimir);
 }
Beispiel #11
0
 private void TB_Llenar_TextChanged(object sender, EventArgs e)
 {
     Metodos.habilitarBoton(!string.IsNullOrEmpty(TB_Llenar.Text), BT_Aceptar);
 }