Пример #1
0
 private void txtProdutoServico_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtServico.Text))
     {
         if (txtServico.Text.Length < 3)
         {
             MessageBox.Show("Servico inválido!", "Informe o servico com mais de 3 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtServico.Focus();
         }
         else
         if (txtFuncionario.Text.Trim().Length > 100)
         {
             MessageBox.Show("Servico inválido!", "Informe o servico com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtServico.Focus();
         }
         else
         if (String.IsNullOrEmpty(txtServico.Text.Trim()))
         {
             MessageBox.Show("Faltou informar o Servico", "Informe o Servico!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtServico.Focus();
         }
         else
         if (!MaskForm.ValidaTexto(txtServico.Text))
         {
             MessageBox.Show("Servico inválido!", "Servico não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtServico.Focus();
         }
     }
 }
Пример #2
0
        private void txtCliente_Leave(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCliente.Text))
            {
                if (txtCliente.Text.Trim().Length > 100)
                {
                    MessageBox.Show("Não é possivel inserir este cliente", "Informe o cliente com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCliente.Focus();
                }
                else if (txtCliente.Text.Length < 3)
                {
                    MessageBox.Show("Cliente inválido!", "Verefique o Cliente!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCliente.Focus();
                    //return false;
                }
                else if (!MaskForm.ValidaTexto(txtCliente.Text))
                {
                    MessageBox.Show("Cliente inválido!", "Cliente não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCliente.Focus();
                }

                else if (String.IsNullOrEmpty(txtCliente.Text.Trim()))
                {
                    MessageBox.Show("Faltou informar o Cliente", "Informe o Cliente!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtCliente.Focus();
                }
            }
        }
Пример #3
0
 private void UserPictureBox_Click(object sender, EventArgs e)
 {
     if (UserManager.GetUserManager().GetCurrentUser().IsAdmin())
     {
         DialogResult result = new MaskForm <LogoutForm>().ShowDialog(this);
         if (DialogResult.OK == result)
         {
             UpdateUser();
         }
         else if (DialogResult.Yes == result)
         {
             if (DialogResult.OK == new SettingForm().ShowDialog(this))
             {
                 //更新
                 InitDataGrid();
             }
         }
     }
     else
     {
         if (DialogResult.OK == new MaskForm <LoginForm>().ShowDialog(this))
         {
             UpdateUser();
         }
     }
 }
Пример #4
0
 private void txtFornecedor_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtFornecedor.Text))
     {
         if (txtFornecedor.Text.Length < 3)
         {
             MessageBox.Show("Fornecedor inválido!", "Informe o fornecedor com mais de 3 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtFornecedor.Focus();
         }
         else
         if (txtFornecedor.Text.Trim().Length > 100)
         {
             MessageBox.Show("Fornecedor inválido!", "Informe o fornecedor com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtFornecedor.Focus();
         }
         else
         if (String.IsNullOrEmpty(txtFornecedor.Text.Trim()))
         {
             MessageBox.Show("Faltou informar o Fornecedor", "Informe o Fornecedor!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtFornecedor.Focus();
         }
         else
         if (!MaskForm.ValidaTexto(txtFornecedor.Text))
         {
             MessageBox.Show("Fornecedor inválido!", "Fornecedor não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtFornecedor.Focus();
         }
     }
 }
Пример #5
0
 private void txtBairro_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtBairro.Text))
     {
         if (txtBairro.Text.Trim().Length > 100)
         {
             MessageBox.Show("Não é possivel inserir este bairro", "Informe o bairro com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtBairro.Focus();
         }
         else if (String.IsNullOrEmpty(txtBairro.Text.Trim()))
         {
             MessageBox.Show("Faltou informar o Bairro", "Informe o Bairro!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtBairro.Focus();
         }
         else if (!MaskForm.ValidaTexto(txtBairro.Text))
         {
             MessageBox.Show("Bairro inválido!", "Bairro não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtBairro.Focus();
         }
         else if (txtBairro.Text.Trim().Length < 3)
         {
             MessageBox.Show("Não é possivel inserir este bairro", "Informe o bairro com mais de 3 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtBairro.Focus();
         }
     }
 }
Пример #6
0
        private bool ValidaCampos()
        {
            if (String.IsNullOrEmpty(txtEstado.Text))
            {
                MessageBox.Show("Faltou informar o Estado", "Informe o Estado!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtEstado.Focus();
                return(false);
            }
            if (!MaskForm.ValidaTexto(txtEstado.Text))
            {
                MessageBox.Show("Estado invalido", "Estado não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtEstado.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtUf.Text))
            {
                MessageBox.Show("Faltou informar o UF", "Informe o UF!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtUf.Focus();
                return(false);
            }
            if (!MaskForm.ValidaTexto(txtUf.Text))
            {
                MessageBox.Show("UF invalido", "UF não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtUf.Focus();
                return(false);
            }

            return(true);
        }
Пример #7
0
        //private void UTIL_ICON_BUTTON1_Click( object sender, EventArgs e )
        //{
        //	Utility.OpenWebPage( GlobalVar.CAFE_RULE_URL, this );
        //}

        //private void UTIL_ICON_BUTTON2_Click( object sender, EventArgs e )
        //{
        //	Utility.OpenWebPage( GlobalVar.CAFE_MANAGE_HOME_URL, this );
        //}

        //private void UTIL_ICON_BUTTON4_Click( object sender, EventArgs e )
        //{
        //	Utility.OpenWebPage( GlobalVar.CAFE_MANAGE_JOINMANAGE_URL, this );
        //}

        //private void UTIL_ICON_BUTTON5_Click( object sender, EventArgs e )
        //{
        //	Utility.OpenWebPage( GlobalVar.NAVER_SPELL_CHECKER_URL, this );
        //}

        //private void UTIL_ICON_BUTTON6_Click( object sender, EventArgs e )
        //{
        //	( new CafeRankViewer( ) ).ShowDialog( );
        //}

        //private void UTIL_ICON_BUTTON7_Click( object sender, EventArgs e )
        //{
        //	( new MemberWarningForm( ) ).ShowDialog( );
        //}

        //private void UTIL_ICON_BUTTON8_Click( object sender, EventArgs e )
        //{
        //	( new MemberActivityStopListForm( ) ).ShowDialog( );
        //}

        public void MaskShow( )
        {
            if (maskForm != null && !maskForm.IsDisposed && !maskForm.Disposing)
            {
                return;
            }

            MaskForm mask = new MaskForm( );

            mask.Owner        = this;
            mask.Size         = new Size(this.Width, this.Height);
            mask.Location     = this.Location;
            this.FormClosing += (object sender2, FormClosingEventArgs e2) =>
            {
                if (mask != null && !mask.IsDisposed && !mask.Disposing)
                {
                    mask.Close( );
                }
            };
            this.LocationChanged += (object sender2, EventArgs e2) =>
            {
                mask.Location = this.Location;
            };
            mask.Show( );
            mask.Refresh( );

            this.maskForm = mask;
        }
Пример #8
0
 private void txtSite_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSite.Text))
     {
         if (!MaskForm.ValidaSite(txtSite.Text))
         {
             MessageBox.Show("Site inválido!", "Formato de site inválido!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtSite.Focus();
         }
     }
 }
Пример #9
0
 public bool ValidaCampo()
 {
     if (String.IsNullOrEmpty(txtPais.Text.Trim()))
     {
         MessageBox.Show("Faltou informar o Pais", "Informe Pais!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtPais.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtPais.Text))
     {
         MessageBox.Show("Pais invalido", "Nome Pais não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtPais.Focus();
         return(false);
     }
     return(true);
 }
Пример #10
0
 private void txtContato_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtContato.Text.Trim()))
     {
         if (!MaskForm.ValidaTexto(txtContato.Text))
         {
             MessageBox.Show("Contato inválido!", "Contato não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtContato.Focus();
         }
         else if (txtContato.Text.Length > 100)
         {
             MessageBox.Show("Não é possivel inserir este contato", "Informe o contato com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtContato.Focus();
         }
     }
 }
Пример #11
0
 private void txtNumero_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtNumero.Text))
     {
         if (txtNumero.Text.Trim().Length > 6)
         {
             MessageBox.Show("Numero inválido!", "Numero não pode conter mais de 10 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtNumero.Focus();
         }
         else if (!MaskForm.ValidaNumero(txtNumero.Text.Trim()))
         {
             MessageBox.Show("Numero inválido!", "Valor dever ser numerico!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtNumero.Focus();
         }
     }
 }
Пример #12
0
 private void txtEmail_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtEmail.Text))
     {
         if (!MaskForm.ValidaEmail(txtEmail.Text))
         {
             MessageBox.Show("Email inválido ", "Informe um email valido!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtEmail.Focus();
         }
         else if (txtEmail.Text.Trim().Length > 30)
         {
             MessageBox.Show("Não é possivel inserir este email", "Informe o email com menos de 30 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtEmail.Focus();
         }
     }
 }
Пример #13
0
 private void txtComplemento_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtComplemento.Text))
     {
         if (!MaskForm.ValidaTexto(txtComplemento.Text))
         {
             MessageBox.Show("Complemento inválido!", "Complemento não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtComplemento.Focus();
         }
         else if (txtComplemento.Text.Trim().Length > 50)
         {
             MessageBox.Show("Complemento inválido!", "Complemento não pode conter mais de 50 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtComplemento.Focus();
         }
     }
 }
Пример #14
0
 private void txtIdCidade_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtIdCidade.Text))
     {
         if (string.IsNullOrEmpty(txtIdCidade.Text))
         {
             MessageBox.Show("Faltou informar o codigo da cidade", "Informer o codigo da cidade", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtIdCidade.Focus();
         }
         else if (!MaskForm.ValidaNumero(txtIdCidade.Text.Trim()))
         {
             MessageBox.Show("Codigo cidade inválido!", "Codigo da cidade dever ser númerico!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtIdCidade.Text = "";
             txtIdCidade.Focus();
         }
     }
 }
Пример #15
0
        private void TxtOutrasDesp_Leave(object sender, EventArgs e)
        {
            MaskForm.TxtMask_Moeda_Leave(sender, e);
            double despesa = Double.Parse(txtOutrasDesp.Text, NumberStyles.Any);
            double frete   = Double.Parse(txtFrete.Text, NumberStyles.Any);
            double seguro  = Double.Parse(txtSeguro.Text, NumberStyles.Any);
            double total   = Double.Parse(txtValorTotal.Text, NumberStyles.Any);

            if (despesa > 0)
            {
                total += despesa + seguro + frete;
                txtTotalPagar.Text = total.ToString("C", CultureInfo.CurrentCulture);
            }
            else
            {
                total += frete + seguro;
                txtTotalPagar.Text = total.ToString("C", CultureInfo.CurrentCulture);
            }
        }
Пример #16
0
        public bool ValidaCampos()
        {
            if (String.IsNullOrEmpty(txtPrecoVenda.Text) || Decimal.Parse(txtPrecoVenda.Text, NumberStyles.Any) < 0)
            {
                MessageBox.Show("Preço inválido!", "Informe o Preço!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtPrecoVenda.Focus();
                return(false);
            }
            if (txtProduto.Text.Length < 3)
            {
                MessageBox.Show("Produto inválido!", "Verefique o Produto!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtProduto.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtProduto.Text.Trim()))
            {
                MessageBox.Show("Faltou informar o Produto", "Informe o Produto!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtProduto.Focus();
                return(false);
            }
            if (!MaskForm.ValidaTexto(txtProduto.Text))
            {
                MessageBox.Show("Produto inválido!", "Produto não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtProduto.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtUnidade.Text.Trim()))
            {
                MessageBox.Show("Faltou informar o Unidade", "Informe a Unidade!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtUnidade.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtCategoriaGrupo.Text.Trim()))
            {
                MessageBox.Show("Faltou informar a Categoria", "Informe a Categoria!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtCategoriaGrupo.Focus();
                return(false);
            }

            return(true);
        }
Пример #17
0
 public bool ValidaCampo()
 {
     if (txtForma.Text.Trim().Length > 100)
     {
         MessageBox.Show("Não é possivel inserir esta forma", "Informe a forma com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtForma.Text))
     {
         MessageBox.Show("Faltou informar a forma", "Informe a forma!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtForma.Text))
     {
         MessageBox.Show("Forma invalida", "Forma não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     return(true);
 }
Пример #18
0
 private void txtNomeFantasia_Leave(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtNomeFantasia.Text))
     {
         if (rbFisica.Checked)
         {
             if (!MaskForm.ValidaTexto(txtNomeFantasia.Text))
             {
                 MessageBox.Show("Apelido inválido!", "Apelido não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 txtNomeFantasia.Focus();
             }
         }
         else
         {
             if (!MaskForm.ValidaTexto(txtNomeFantasia.Text))
             {
                 MessageBox.Show("Nome Fantasia inválido!", "Nome Fantasia não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 txtNomeFantasia.Focus();
             }
         }
     }
 }
Пример #19
0
 public Boolean ValidaUsuarioSenha()
 {
     if (String.IsNullOrEmpty(txtUsuario.Text.Trim()))
     {
         MessageBox.Show("Usuario inválido!", "Informe um usuario!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtUsuario.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtUsuario.Text))
     {
         MessageBox.Show("Usuario inválido!", "Usuario não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtUsuario.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtSenha.Text.Trim()))
     {
         MessageBox.Show("Senha inválida!", "Informe uma senha!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtSenha.Focus();
         return(false);
     }
     return(true);
 }
Пример #20
0
        public bool ValidaCampos()
        {
            if (txtServico.Text.Length < 3)
            {
                MessageBox.Show("Serviço inválido!", "Verefique o Serviço!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtServico.Focus();
                return(false);
            }
            if (!MaskForm.ValidaTexto(txtServico.Text))
            {
                MessageBox.Show("Serviço inválido!", "Serviço não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtServico.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtServico.Text.Trim()))
            {
                MessageBox.Show("Faltou informar o Serviço", "Informe o Serviço!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtServico.Focus();
                return(false);
            }

            if (txtCodFornecedor.Text.Trim() == String.Empty & txtCodFornecedor.Text.Length < 2)
            {
                MessageBox.Show("Faltou informar o Código do Funcionario", "Informe o Código do Funcionario!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtCodFornecedor.Focus();
                return(false);
            }
            if (String.IsNullOrEmpty(txtFuncionario.Text.Trim()) & txtFuncionario.Text.Length < 2)
            {
                MessageBox.Show("Faltou informar o Funcionario", "Informe o Funcionario!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtFuncionario.Focus();
                return(false);
            }

            return(true);
        }
Пример #21
0
 private void TxtValorTotal_Leave(object sender, EventArgs e)
 {
     MaskForm.TxtMask_Moeda_Leave(sender, e);
 }
Пример #22
0
 private void TxtCodCondicao_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Moeda_KeyPress(sender, e);
 }
Пример #23
0
 public bool ValidaCampos()
 {
     if (txtFornecedor.Text.Length < 3)
     {
         MessageBox.Show("Fornecedor inválido!", "Verefique o Fornecedor!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtFornecedor.Focus();
         return(false);
     }
     if (txtFornecedor.Text.Trim().Length > 100)
     {
         MessageBox.Show("Não é possivel inserir este fornecedor", "Informe o fornecedor com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtFornecedor.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtFornecedor.Text.Trim()))
     {
         MessageBox.Show("Faltou informar o Fornecedor", "Informe o Fornecedor!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtFornecedor.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtFornecedor.Text))
     {
         MessageBox.Show("Fornecedor inválido!", "Fornecedor não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtFornecedor.Focus();
         return(false);
     }
     if (txtEndereco.Text.Trim().Length > 100)
     {
         MessageBox.Show("Não é possivel inserir este endereço", "Informe o endereço com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtEndereco.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtEndereco.Text.Trim()))
     {
         MessageBox.Show("Faltou informar o Endereço", "Informe o Endereço!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtEndereco.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtEndereco.Text))
     {
         MessageBox.Show("Endereço inválido!", "Endereço não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtEndereco.Focus();
         return(false);
     }
     if (txtBairro.Text.Trim().Length > 100)
     {
         MessageBox.Show("Não é possivel inserir este bairro", "Informe o bairro com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtBairro.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtBairro.Text.Trim()))
     {
         MessageBox.Show("Faltou informar o Bairro", "Informe o Bairro!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtBairro.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtBairro.Text))
     {
         MessageBox.Show("Bairro inválido!", "Bairro não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtBairro.Focus();
         return(false);
     }
     if (txtCep.Text.Trim().Length != 8)
     {
         MessageBox.Show("CEP inválido, é necessário  8 números.", "Informe o CEP!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCep.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtIdCidade.Text.Trim()) & txtIdCidade.Text.Length < 0)
     {
         MessageBox.Show("Faltou informar o Cidade", "Informe o Cidade!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtIdCidade.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtCelular.Text.Trim()) & txtCelular.Text.Length < 11)
     {
         MessageBox.Show("Faltou informar o Celular", "Informe o Celular!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCelular.Focus();
         return(false);
     }
     if (Double.Parse(txtLimiteCredito.Text, NumberStyles.Any) < 0)
     {
         MessageBox.Show("Limite de crédito inválido", "Informe o Limite de crédito!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtLimiteCredito.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(txtCodCondicao.Text.Trim()))
     {
         MessageBox.Show("Código Condição de Pagamento Inválido!", "Informe o Código da Condição de Pagamento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCodCondicao.Focus();
         return(false);
     }
     else if (Convert.ToDecimal(txtCodCondicao.Text) < 0)
     {
         MessageBox.Show("Código Condição de Pagamento Inválido!", "Verefique o Código Condição de Pagamento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCodCondicao.Focus();
         return(false);
     }
     if (string.IsNullOrEmpty(txtCondicao.Text.Trim()))
     {
         MessageBox.Show("Condição de Pagamento Inválida!", "Informe a Condição de Pagamento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCondicao.Focus();
         return(false);
     }
     else if (txtCondicao.Text.Length < 3)
     {
         MessageBox.Show("Condição de Pagamento Inválida!", "Informe a Condição de Pagamento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtCondicao.Focus();
         return(false);
     }
     if (rbFisica.Checked)
     {
         if (!IsCpf(txtCnpj.Text) || txtCnpj.Text.Length < 11)
         {
             MessageBox.Show("CPF Inválido!", "Verefique o CPF!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtCnpj.Focus();
             return(false);
         }
         if (txtDtFundacao.Text == DateTime.Now.ToString())
         {
             MessageBox.Show("Data Nascimento inválida", "Informe a Data de Nascimento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtDtFundacao.Focus();
             return(false);
         }
         else if (Convert.ToDateTime(txtDtFundacao.Text) > DateTime.Now)
         {
             MessageBox.Show("Data Nascimento inválida", "Informe a Data de Nascimento!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtDtFundacao.Focus();
             return(false);
         }
         if (txtSexo.Text.Trim() == String.Empty)
         {
             MessageBox.Show("Faltou informar o Sexo", "Informe o Sexo!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtSexo.Focus();
             return(false);
         }
         else if (txtSexo.Text != "M" & txtSexo.Text != "F")
         {
             MessageBox.Show("Sexo inválido, sexo deve ser ( 'M' ou 'F')", "Verefique o Sexo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtSexo.Focus();
             return(false);
         }
     }
     else if (rbJuridica.Checked)
     {
         if (!IsCnpj(txtCnpj.Text) || txtCnpj.Text.Length < 14)
         {
             MessageBox.Show("CNPJ Inválido!", "Verefique o CNPJ!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtCnpj.Focus();
             return(false);
         }
         if (txtDtFundacao.Text == DateTime.Now.ToString())
         {
             MessageBox.Show("Data Fundação inválida", "Informe a Data de Fundação!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtDtFundacao.Focus();
             return(false);
         }
         else if (Convert.ToDateTime(txtDtFundacao.Text) > DateTime.Now)
         {
             MessageBox.Show("Data Fundação inválida", "Informe a Data de Fundação!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtDtFundacao.Focus();
             return(false);
         }
         return(true);
     }
     return(true);
 }
Пример #24
0
 private void txtSexo_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Sexo_KeyPress(sender, e);
 }
Пример #25
0
 private void TxtOutrasDesp_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Moeda_KeyPress(sender, e);
 }
Пример #26
0
 private void TxtSeguro_KeyUp(object sender, KeyEventArgs e)
 {
     MaskForm.TxtMask_Moeda_KeyUp(sender, e);
 }
Пример #27
0
 private void txtNumero_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_ValidaNumeroLetras_KeyPress(sender, e);
 }
Пример #28
0
 private void TxtValorTotal_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Moeda_KeyPress(sender, e);
 }
Пример #29
0
 private void txtIdCidade_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Numero_KeyPress(sender, e);
 }
Пример #30
0
 private void txtCodProduto_KeyPress(object sender, KeyPressEventArgs e)
 {
     MaskForm.TxtMask_Numero_KeyPress(sender, e);
 }