Exemplo n.º 1
0
        private bool Validar()
        {
            if (this.txtCodigo.Text.Length == 0)
            {
                this.txtCodigo.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un codigo", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }

            if (this.txtRif.Text.Length == 0)
            {
                this.txtRif.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un rif/cedula", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }
            if (this.txtNombre.Text.Length == 0)
            {
                this.txtNombre.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un nombre", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }
            if (this.txtIdb.Text.Length == 0)
            {
                this.txtIdb.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un idb", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }
            if (this.txtNotaDebito.Text.Length == 0)
            {
                this.txtNotaDebito.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un valor en  nota de debito", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }
            if (this.txtNotaCredito.Text.Length == 0)
            {
                this.txtNotaCredito.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un valor en  nota de credito", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }
            if (this.txtNumCheque.Text.Length == 0)
            {
                this.txtNumCheque.BackColor = Color.Red;
                MessageBox.Show("Disculpe ingrese un valor en  numero de cheque", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }

            App_Code.Base oBase = new App_Code.Base();
            if (!oBase.IsValidEmail(this.txtEmail.Text.ToString()))
            {
                this.txtEmail.BackColor = Color.Red;
                MessageBox.Show("Disculpe email erroneo", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(true);
            }

            return(false);
        }