Exemplo n.º 1
0
        private void controleDePreçosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var definicoes = new FormDefinicoes
            {
                ControlBox = true
            };

            definicoes.Show();
        }
Exemplo n.º 2
0
        private bool validaFuncionario()
        {
            bool ret = false;

            if (String.IsNullOrWhiteSpace(txtNome.Text))
            {
                MessageBox.Show("Favor preencher o nome do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(maskedCpf.Text))
            {
                MessageBox.Show("Favor preencher o CPF do funcionário.");
            }
            //else if (!String.IsNullOrWhiteSpace(maskedCpf.Text))
            //{
            //	if (!Utilidades.Utilidades.IsCpf(maskedCpf.Text))
            //	{
            //		MessageBox.Show("CPF inválido, favor conferir o número digitado.");
            //	}
            //}
            else if (String.IsNullOrWhiteSpace(txtRG.Text))
            {
                MessageBox.Show("Favor preencher o RG do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(txtEmail.Text))
            {
                MessageBox.Show("Favor preencher o Email do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(txtTelCel.Text))
            {
                MessageBox.Show("Favor preencher o Telefone Celular do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(txtSalario.Text))
            {
                MessageBox.Show("Favor preencher o Salário do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(comboCargo.Text))
            {
                if (comboCargo.Items.Count < 1)
                {
                    if (MessageBox.Show("Nenhum Cargo Cadastrado, Deseja cadastrar um agora?", "Pergunta", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        var cargos = new FormDefinicoes
                        {
                            MdiParent   = this.MdiParent,
                            ControlBox  = false,
                            WindowState = FormWindowState.Maximized,
                            ShowIcon    = false
                        };
                        cargos.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Favor preencher o Cargo do funcionário.");
                }
            }
            else if (String.IsNullOrWhiteSpace(txtCTPS.Text))
            {
                MessageBox.Show("Favor preencher o numero da CTPS do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(txtPIS.Text))
            {
                MessageBox.Show("Favor preencher o PIS do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(txtTitEleitor.Text))
            {
                MessageBox.Show("Favor preencher o Titulo de eleitor do funcionário.");
            }
            else if (String.IsNullOrWhiteSpace(maskedCEP.Text))
            {
                MessageBox.Show("Favor preencher o endereço do funcionário.");
            }
            else
            {
                ret = true;
            }
            return(ret);
        }