示例#1
0
 private double valorCorrespondiente()
 {
     if (!string.IsNullOrEmpty(TB_CorrespA.Text))
     {
         return(Metodos.validarYConvertirADouble(TB_CorrespA.Text));
     }
     else
     {
         return(Double.NaN);
     }
 }
示例#2
0
 private double valorTolerado(int columna)
 {
     if (!String.IsNullOrEmpty((string)DGV_restricciones.Rows[1].Cells[columna].Value))
     {
         return(Metodos.validarYConvertirADouble((string)DGV_restricciones.Rows[1].Cells[columna].Value));
     }
     else
     {
         return(Double.NaN);
     }
 }
示例#3
0
 private double valorEsperado()
 {
     if (!String.IsNullOrEmpty(TB_ValorEsperado.Text))
     {
         return(Metodos.validarYConvertirADouble(TB_ValorEsperado.Text));
     }
     else
     {
         return(Double.NaN);
     }
 }
示例#4
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);
            }
        }
示例#5
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();
            }
        }
示例#6
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;
                }
            }
        }