示例#1
0
        public bool RevisionDeControlIndependiente(Control.ControlCollection Controles)
        {
            bool isValid = true;

            foreach (Control ctrl in Controles)
            {
                if (ctrl is TextBoxRegular)
                {
                    TextBoxRegular myTextBox = ctrl as TextBoxRegular;
                    if (myTextBox.Obligatorio)
                    {
                        isValid = myTextBox.Validar() ? isValid : false;
                    }
                    else if (myTextBox.CantidadMinima)
                    {
                        if (!string.IsNullOrEmpty(myTextBox.Text))
                        {
                            isValid = myTextBox.Validar() ? isValid : false;
                        }
                    }
                }
                else if (ctrl is MaskedTextBoxRegular)
                {
                    MaskedTextBoxRegular myMaskedTextBox = ctrl as MaskedTextBoxRegular;
                    if (myMaskedTextBox.Obligatorio)
                    {
                        isValid = myMaskedTextBox.Validar() ? isValid : false;
                    }
                    else if (myMaskedTextBox.CantidadMinima)
                    {
                        if (!string.IsNullOrEmpty(myMaskedTextBox.Text))
                        {
                            isValid = myMaskedTextBox.Validar() ? isValid : false;
                        }
                    }
                }
                else if (ctrl is ComboBoxRegular)
                {
                    ComboBoxRegular myComboBoxRegular = ctrl as ComboBoxRegular;
                    if (myComboBoxRegular.Obligatorio)
                    {
                        isValid = myComboBoxRegular.Validar() ? isValid : false;
                    }
                }
                else if (ctrl is Panel)
                {
                    isValid = ValidarControles(ctrl as Panel) ? isValid : false;
                }
            }
            return(isValid);
        }
示例#2
0
 public void DeshabilitarControlesIndependiente(Control.ControlCollection Controles)
 {
     foreach (Control ctrl in Controles)
     {
         if (ctrl is TextBoxRegular)
         {
             TextBoxRegular myTextBox = ctrl as TextBoxRegular;
             if (myTextBox.Deshabilitar)
             {
                 myTextBox.Enabled = false;
                 myTextBox.RemoveErrorProvider();
             }
         }
         else if (ctrl is MaskedTextBoxRegular)
         {
             MaskedTextBoxRegular myMaskedTextBox = ctrl as MaskedTextBoxRegular;
             if (myMaskedTextBox.Deshabilitar)
             {
                 myMaskedTextBox.Enabled = false;
                 myMaskedTextBox.RemoveErrorProvider();
             }
         }
         else if (ctrl is ComboBoxRegular)
         {
             ComboBoxRegular myComboBoxRegular = ctrl as ComboBoxRegular;
             if (myComboBoxRegular.Deshabilitar)
             {
                 myComboBoxRegular.Enabled = false;
                 myComboBoxRegular.RemoveErrorProvider();
             }
         }
         else if (ctrl is CheckBoxEstado)
         {
             CheckBoxEstado myCheckBoxEstado = ctrl as CheckBoxEstado;
             if (myCheckBoxEstado.Deshabilitar)
             {
                 myCheckBoxEstado.Enabled = false;
             }
         }
         else if (ctrl is Panel)
         {
             DeshabilitarControles(ctrl as Panel);
         }
     }
 }
示例#3
0
 public void LimpiarControlesIndependiente(Control.ControlCollection Controles)
 {
     foreach (Control ctrl in Controles)
     {
         if (ctrl is TextBoxRegular)
         {
             TextBoxRegular myTextBox = ctrl as TextBoxRegular;
             if (myTextBox.Limpiar)
             {
                 myTextBox.Clean();
             }
         }
         else if (ctrl is MaskedTextBoxRegular)
         {
             MaskedTextBoxRegular myMaskedTextBox = ctrl as MaskedTextBoxRegular;
             if (myMaskedTextBox.Limpiar)
             {
                 myMaskedTextBox.Clean();
             }
         }
         else if (ctrl is ComboBoxRegular)
         {
             ComboBoxRegular myComboBoxRegular = ctrl as ComboBoxRegular;
             if (myComboBoxRegular.Limpiar)
             {
                 myComboBoxRegular.Clean();
             }
         }
         else if (ctrl is CheckBoxEstado)
         {
             CheckBoxEstado myCheckBoxEstado = ctrl as CheckBoxEstado;
             if (myCheckBoxEstado.Limpiar)
             {
                 myCheckBoxEstado.Checked = !myCheckBoxEstado.DefaultLimpiarValue;
             }
         }
         else if (ctrl is Panel)
         {
             LimpiarControles(ctrl as Panel);
         }
     }
 }
示例#4
0
 public void HabilitarControlesIndependiente(Control.ControlCollection Controles)
 {
     foreach (Control ctrl in Controles)
     {
         if (ctrl is TextBoxRegular)
         {
             TextBoxRegular myTextBox = ctrl as TextBoxRegular;
             if (myTextBox.Habilitar)
             {
                 myTextBox.Enabled = true;
             }
         }
         else if (ctrl is MaskedTextBoxRegular)
         {
             MaskedTextBoxRegular myMaskedTextBox = ctrl as MaskedTextBoxRegular;
             if (myMaskedTextBox.Habilitar)
             {
                 myMaskedTextBox.Enabled = true;
             }
         }
         else if (ctrl is ComboBoxRegular)
         {
             ComboBoxRegular myComboBoxRegular = ctrl as ComboBoxRegular;
             if (myComboBoxRegular.Habilitar)
             {
                 myComboBoxRegular.Enabled = true;
             }
         }
         else if (ctrl is CheckBoxEstado)
         {
             CheckBoxEstado myCheckBoxEstado = ctrl as CheckBoxEstado;
             if (myCheckBoxEstado.Habilitar)
             {
                 myCheckBoxEstado.Enabled = true;
             }
         }
         else if (ctrl is Panel)
         {
             HabilitarControles(ctrl as Panel);
         }
     }
 }