Пример #1
0
        private void btnExluir_Click(object sender, EventArgs e)
        {
            ValidacaoGeral validacaoGeral = new ValidacaoGeral();
            bool           checar         = validacaoGeral.validaDatagrid(this);

            if (checar)
            {
                CrudLocador crudLocador = new CrudLocador(inicio);
                crudLocador.checarExclusao(this);
            }
        }
Пример #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            ValidacaoGeral validacaoGeral = new ValidacaoGeral();
            bool           checar         = validacaoGeral.validaDatagrid(this);

            if (checar)
            {
                CrudLocador     crudLocador = new CrudLocador(inicio);
                DataGridViewRow selectedRow = dgvLocadores.Rows[linha];
                int             id_Locador  = Convert.ToInt16(selectedRow.Cells[0].Value);
                locador = new CadLocImov1("editar", id_Locador, inicio);
                crudLocador.mostrarEditar(this, locador);
            }
        }
Пример #3
0
        private void btnSelecionar_Click(object sender, EventArgs e)
        {
            ValidacaoGeral validacaoGeral = new ValidacaoGeral();
            bool           checar         = validacaoGeral.validaDatagrid(this);

            if (checar)
            {
                CrudLocador crudLocador = new CrudLocador(inicio);
                int         id_locador  = crudLocador.getId(dgvLocadores, linha);

                cadImov = new cadLocImov2(usuario, id_locador, inicio);
                cadImov.txtLocador.Text        = crudLocador.getNameById(id_locador);
                cadImov.cboStatus.SelectedItem = cadImov.cboStatus.Items[1];
                cadImov.cboUf.SelectedItem     = cadImov.cboUf.Items[24];
                cadImov.MdiParent = inicio;
                cadImov.Show();
                this.Visible = false;
            }
        }
Пример #4
0
        //btnAvançar
        private void button1_Click(object sender, EventArgs e)
        {
            ValidacaoGeral validacaoGeral = new ValidacaoGeral();
            bool           checar         = validacaoGeral.imagemDescricaoVazios(this);

            if (checar)
            {
                CadLocImov3 fimCadImov  = new CadLocImov3(this, usuario, id_locador, inicio);
                CrudLocador crudLocador = new CrudLocador(inicio);

                fimCadImov.txtLocador.Text = crudLocador.getNameById(id_locador);
                this.Visible         = false;
                fimCadImov.MdiParent = inicio;
                fimCadImov.Show();
            }
            else
            {
                MessageBox.Show("Verifique se a imagem foi escolhida e se o imóvel possui descrição", "Mensagem", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
        }
Пример #5
0
        private void VerLocadores_Load(object sender, EventArgs e)
        {
            rbCrescente.Checked = true;
            if (imovel == "imovel")
            {
                lblTitulo.Text      = "Selecione um Locador para o Imóvel";
                lblTitulo.BackColor = Color.White;
                lblTitulo.ForeColor = Color.Red;

                this.btnCadastrar.Visible = false;
                this.btnEditar.Visible    = false;
                this.btnDeletar.Visible   = false;

                CrudLocador crudLocador = new CrudLocador(inicio);
                crudLocador.exibir(dgvLocadores);
            }
            else
            {
                this.btnSelecionar.Visible = false;
                CrudLocador crudLocador = new CrudLocador(inicio);
                crudLocador.exibir(dgvLocadores);
            }
        }
Пример #6
0
        //btnAvançar
        private void button1_Click(object sender, EventArgs e)
        {
            ValidacaoGeral validacaoGeral = new ValidacaoGeral();
            bool           checar1        = validacaoGeral.checarCamposVazios(this);
            bool           checar2        = validacaoGeral.validaCpf(this);
            bool           checar3        = validacaoGeral.validaRg(this);
            bool           checar4        = validacaoGeral.validaEmail(this);
            bool           checar5        = validacaoGeral.contarCamposCpf(mtxtCpf);
            bool           checar6        = validacaoGeral.contarCamposRg(mtxtRg);
            bool           checar7        = validacaoGeral.validaTelefone(mtxtTelRes1, mtxtTelRes2,
                                                                          mtxtTelCel1, mtxtTelCel2);
            bool checar8 = validacaoGeral.validaData(mtxtDataNasc);
            bool checar9 = validacaoGeral.checaEmail(this);

            if (checar1 && checar2 && checar3 && checar4 && checar5 && checar6 && checar7 && checar8 &&
                checar9)
            {
                CrudLocador crudLocador = new CrudLocador(inicio);

                bool ValCad = crudLocador.cadastrar(txtNome, mtxtCpf, mtxtRg, mtxtDataNasc, mtxtTelRes1, mtxtTelRes2, mtxtTelCel1, mtxtTelCel2,
                                                    txtEmail, txtEnd);
                if (ValCad)
                {
                    int id_Locador = crudLocador.getId(mtxtCpf);

                    cadLocImov2 imovel = new cadLocImov2(usuario, id_Locador, inicio);
                    imovel.txtLocador.Text        = crudLocador.getNameById(id_Locador);
                    imovel.cboStatus.SelectedItem = imovel.cboStatus.Items[1];
                    imovel.cboUf.SelectedItem     = imovel.cboUf.Items[24];
                    this.Visible = false;

                    imovel.MdiParent = inicio;
                    imovel.Show();
                }
            }
            else
            {
                if (!checar2)
                {
                    MessageBox.Show("Esse CPF já está cadastrado", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar3)
                {
                    MessageBox.Show("Esse RG já está cadastrado", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar4)
                {
                    MessageBox.Show("Esse E-mail está incorreto", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar5)
                {
                    MessageBox.Show("Preencha corretamente seu CPF", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar6)
                {
                    MessageBox.Show("Preencha corretamente seu RG", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar7)
                {
                    MessageBox.Show("Você deve registrar pelo menos 1 telefone completo", "Mensagem", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
                if (!checar8)
                {
                    MessageBox.Show("Data de nascimento inválida. Você deve ser maior de 18 anos",
                                    "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                if (!checar9)
                {
                    MessageBox.Show("Esse e-mail já está cadastrado, escolha outro",
                                    "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Пример #7
0
        private void btnDesfazer_Click(object sender, EventArgs e)
        {
            CrudLocador crudLocador = new CrudLocador(inicio);

            crudLocador.exibir(dgvLocadores);
        }