private void VerImoveis_Load(object sender, EventArgs e) { CrudImovel crudImovel = new CrudImovel(inicio); crudImovel.exibir(dgvImovel); rbCidade.Checked = true; rbAlugados.Checked = true; }
private void btnDesfazer2_Click(object sender, EventArgs e) { CrudImovel crudImovel = new CrudImovel(inicio); crudImovel.exibir(dgvImovel); OutrasFuncionalidades funcionalidades = new OutrasFuncionalidades(); funcionalidades.desfazerMostrarImovel(); }
private void btnDeletar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudImovel crudImovel = new CrudImovel(inicio); crudImovel.deletar(linha, dgvImovel); } }
private void btnDetalhe_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudImovel crudImovel = new CrudImovel(inicio); detalheImovel = new DetalheImovel(inicio); detalheImovel.btnMudar.Visible = false; crudImovel.mostrarDetalhe(this, detalheImovel); } }
private void btnEditar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudImovel crudImovel = new CrudImovel(this, inicio); DataGridViewRow selectedRow = dgvImovel.Rows[linha]; int id_Imovel = Convert.ToInt16(Convert.ToInt16(selectedRow.Cells[0].Value)); detalheImovelEditar = new DetalheImovel(id_Imovel, usuario, inicio); crudImovel.mostrarEditar(this, detalheImovelEditar); } }
private void btnSalvar_Click(object sender, EventArgs e) { //fimCadImov.txtLocador.Text = crudLocador.getNameById(id_locador); ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.checarCamposVaziosImoveisTela1(this); txtValorAluguel.Text = txtValorAluguel.Text.Replace(',', '.'); bool checar9 = validacaoGeral.validaSalario(txtValorAluguel); if (checar && checar9) { CrudImovel crudImovel = new CrudImovel(inicio); byte[] imagemSalvar; try { imagemSalvar = ConvertImageToBinary(pbImovel.Image); String caminhoImagem = picpath; bool ValCad = crudImovel.cadastrar(caminhoImagem, imagemSalvar, rtxtDescricao, txtRuaAvenida, txtComplemento, cboUf, txtNumero, txtBairro, txtCidade, txtValorAluguel, cboStatus, usuario, id_locador); if (ValCad) { this.Visible = false; } } catch (Exception ex) { MessageBox.Show("Escolha uma Imagem", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { if (!checar) { MessageBox.Show("Campo(s) vazio(s)", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (!checar9) { MessageBox.Show("O valor do aluguel foi preenchido incorretamente", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnSalvar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.checarCamposVaziosImoveisTela2(this); if (checar) { CrudImovel crudImovel = new CrudImovel(inicio); byte[] imagemSalvar = ConvertImageToBinary(imovel1.pbImovel.Image); String caminhoImagem = imovel1.picpath; crudImovel.cadastrar(caminhoImagem, imagemSalvar, imovel1.rtxtDescricao, txtRuaAvenida, txtComplemento, cboUf, txtNumero, txtBairro, txtCidade, txtValorAluguel, cboStatus, usuario, id_locador); this.Visible = false; } else { MessageBox.Show("Campo(s) vazio(s)", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click(object sender, EventArgs e) { CrudImovel crudImovel = new CrudImovel(inicio); crudImovel.exibir(dgvImovel); }
private void btnSalvar_Click(object sender, EventArgs e) { CrudImovel crudImovel = new CrudImovel(inicio); crudImovel.salvarEditar(this); }