예제 #1
0
        void FrmCadFuncionariosLoad(object sender, EventArgs e)
        {
            funcionarios = new cFuncionarios();
            this.Cursor  = Cursors.WaitCursor;
            funcionarios.Carrega(dgvCadastro);
            this.Cursor = Cursors.Default;
            cEstados estados = new cEstados();

            this.Cursor = Cursors.WaitCursor;
            estados.Carrega(cbxEstados);
            this.Cursor = Cursors.Default;
            cCargos cargos = new cCargos();

            this.Cursor = Cursors.WaitCursor;
            cargos.Carrega(cbxCargos);
            this.Cursor = Cursors.Default;
            SetaEdicaoLocal(false);
            result = false;
        }
예제 #2
0
        bool Valida()
        {
            if (cbxNaturezas.Text.Trim().Length == 0)
            {
                MessageBox.Show("Natureza", "Campo Obrigatório",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                cbxNaturezas.Focus();
                return(false);
            }
            cParceiros parceiros = new cParceiros();

            if ((edtParceiro.Text.Trim().Length > 0) && !parceiros.Existe(edtParceiro.Text.Trim()))
            {
                MessageBox.Show(edtParceiro.Text, "Parceiro não Cadastrado",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                edtParceiro.Focus();
                return(false);
            }
            cFuncionarios funcionarios = new cFuncionarios();

            if ((edtFuncionario.Text.Trim().Length > 0) && !funcionarios.Existe(edtFuncionario.Text.Trim()))
            {
                MessageBox.Show(edtFuncionario.Text, "Funcionário não Cadastrado",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                edtFuncionario.Focus();
                return(false);
            }
            if ((edtParceiro.Text.Trim().Length + edtFuncionario.Text.Trim().Length) == 0)
            {
                MessageBox.Show("Parceiro ou Funcionário", "Campo Obrigatório",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                edtParceiro.Focus();
                return(false);
            }
            return(true);
        }