Beispiel #1
0
        public bool FormValidate()
        {
            try
            {
                bool Valid = true;

                if (string.IsNullOrEmpty(textBoxClave.Text))
                {
                    Valid = false;
                    throw new Exception("Ingrese una clave para el concepto");
                }
                else if (string.IsNullOrEmpty(textBoxConcepto.Text))
                {
                    Valid = false;
                    throw new Exception("Ingrese un nombre para el concepto");
                }
                return(Valid);
            }
            catch (Exception ex)
            {
                cFAT100010 alr = new Alerts.cFAT100010("ERROR", string.Format("{0}", ex.Message), MessageBoxIcon.Error);
                alr.ShowDialog();
                return(false);
            }
        }
Beispiel #2
0
        public bool FormValidate()
        {
            try
            {
                bool Valid = true;

                if (string.IsNullOrEmpty(textBoxNumControl.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar un Numero de Control");
                }
                else if (string.IsNullOrEmpty(textBoxNombre.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar un Número de control válido");
                }
                else if (comboBoxAusentismo.SelectedValue.ToString() == "")
                {
                    Valid = false;
                    throw new Exception("Debe ingresar el Concepto de Ausentismo");
                }
                else if (comboBoxEstadoAsig.SelectedValue.ToString() == "")
                {
                    Valid = false;
                    throw new Exception("Seleccione un estatus del ausentismo");
                }
                else if (dateTimeFechaInicio.Value > dateTimeFechaFin.Value)
                {
                    Valid = false;
                    throw new Exception("La Fecha de inicio no debe ser menor a la fecha fin");
                }

                return(Valid);
            }
            catch (Exception ex)
            {
                cFAT100010 alr = new Alerts.cFAT100010("ERROR", string.Format("{0}", ex), MessageBoxIcon.Error);
                alr.ShowDialog();
                return(false);
            }
        }
Beispiel #3
0
        public bool FormValidate()
        {
            try
            {
                bool Valid = true;

                if (string.IsNullOrEmpty(textBoxCurp.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar Curp");
                }
                else if (string.IsNullOrEmpty(textBoxNombre.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar el Nombre");
                }
                else if (string.IsNullOrEmpty(textBoxApellidos.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar el Apellidos");
                }
                else if (comboBoxEscolaridad.SelectedValue.ToString() == "")
                {
                    Valid = false;
                    throw new Exception("Seleccione una escolaridad");
                }

                else if (String.IsNullOrEmpty(textBoxCalle.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar el Calle");
                }
                else if (String.IsNullOrEmpty(textBoxTelefono.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingesar el Telefono");
                }
                else if (comboBoxEstadoCivil.SelectedValue.ToString() == "")
                {
                    Valid = false;
                    throw new Exception("Seleccione estado civil");
                }
                else if (int.Parse(comboBoxDepartamento.SelectedValue.ToString()) == 0)
                {
                    Valid = false;
                    throw new Exception("Debe ingresar Departamento");
                }
                else if (int.Parse(comboBoxPuesto.SelectedValue.ToString()) == 0)
                {
                    Valid = false;
                    throw new Exception("Seleccione un puesto");
                }
                else if (comboBoxTipoSeguro.SelectedValue.ToString() == "")
                {
                    Valid = false;
                    throw new Exception("Seleccione tipo de seguro");
                }
                else if (String.IsNullOrEmpty(textBoxUsuario.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar un Usuario");
                }
                else if (String.IsNullOrEmpty(textBoxPassword.Text))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar un Password");
                }

                else if (String.IsNullOrEmpty(comboBoxRol.SelectedValue.ToString()))
                {
                    Valid = false;
                    throw new Exception("Debe ingresar rol");
                }
                else if (UsersBLL.UserExists(textBoxUsuario.Text) && IdUser == 0)
                {
                    Valid = false;
                    throw new Exception("El usuario ya existe");
                }
                else if (!RegularExpressionBLL.SingleNumber(textBoxCodigoPostal.Text))
                {
                    Valid = false;
                    throw new Exception("Ingrese Codigo Postal Valido");
                }
                else if (!RegularExpressionBLL.ValidEmal(textBoxEmail.Text))
                {
                    Valid = false;
                    throw new Exception("Ingrese Correo electronico Valido");
                }
                else if (!RegularExpressionBLL.ValidDecimal(textBoxSueldo.Text))
                {
                    Valid = false;
                    throw new Exception("Ingrese sueldo valido");
                }

                return(Valid);
            }
            catch (Exception ex)
            {
                cFAT100010 alr = new Alerts.cFAT100010("Informacón", string.Format("{0}", ex.Message), MessageBoxIcon.Error);
                alr.ShowDialog();
                return(false);
            }
        }