예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            cadLocImov2 imovelLoc = new cadLocImov2();

            imovelLoc.Visible = true;
            this.Dispose();
        }
예제 #2
0
        public CadLocImov3(cadLocImov2 imovel1, int usuario, int id_locador, home inicio)
        {
            InitializeComponent();
            this.MaximizeBox = false;

            this.inicio     = inicio;
            this.imovel1    = imovel1;
            this.usuario    = usuario;
            this.id_locador = id_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           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);
                }
            }
        }