//btnLogar private void button1_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar1 = validacaoGeral.checarVazio(this); bool checar2 = validacaoGeral.userCadastrado(this); if (checar1 && !checar2) { LoginSistema sistema = new LoginSistema(); int checar = sistema.logar(txtUsuario, txtSenha); int idUser = sistema.getId(txtUsuario); if (checar == 1) { home logar = new home(idUser); logar.Visible = true; this.Visible = false; } else { MessageBox.Show("Usuário e/ou senha inválidos ou usuário não existe!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else if (!checar1) { MessageBox.Show("Campo(s) vazio(s)", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void CadLocImov3_Load(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); validacaoGeral.tamanho(this); cboStatus.SelectedItem = cboStatus.Items[1]; }
//btnDeletar private void button5_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { DataGridViewRow selectedRow = dgvAtendimentos.Rows[linha]; int id_User = -1; try { id_User = Convert.ToInt16(selectedRow.Cells[5].Value); }catch (Exception ex) { MessageBox.Show("Ops! Erro na conversão do Id_User pra inteiro", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (id_User != inicio.usuario) { MessageBox.Show("Não é possível excluir o atendimento de outro funcionário", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { CrudAtendimento crudAtendimento = new CrudAtendimento(inicio); crudAtendimento.deletar(dgvAtendimentos, linha); } } }
private void CadFunc_Load(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); validacaoGeral.tamanho(this); cpf = txtCpf.Text; rg = txtRg.Text; email = txtEmail.Text; }
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 btnDeletar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudFiador crudFiador = new CrudFiador(inicio); crudFiador.deletar(this); } }
private void btnOk_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocacao crudLocacao = new CrudLocacao(inicio); crudLocacao.setNomeLocatarioById(this); } }
private void btnVerFonteRenda_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { crudFonte = new CrudFonteDeRenda(inicio); crudFonte.exibir(this); } }
private void btnEditar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudFonteDeRenda crudFonte = new CrudFonteDeRenda(inicio); crudFonte.mostrarEditar(this); } }
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); } }
private void button6_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudAtendimento crudAtendimento = new CrudAtendimento(usuario, dgvAtendimentos, linha, inicio); atendimentoEdit = new Atendimento(usuario, dgvAtendimentos, linha, inicio); crudAtendimento.mostrarEditar(dgvAtendimentos, usuario, linha, atendimentoEdit); } }
private void btnEditar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocatario crudLocatario = new CrudLocatario(inicio); cadLocatario = new CadLocatario("Editar", usuario, inicio); crudLocatario.mostrarEditarLocatario(this, cadLocatario); } }
private void btnFiadorDeUmaLocacao_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocacao crudLocacao = new CrudLocacao(inicio); fiadores = new verFiadores(this, "verLocacoes", usuario, inicio); crudLocacao.verFiadoresDeUmaLocacao(this, fiadores); } }
//btnEditar private void button4_Click_1(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudFunc crudfunc = new CrudFunc(inicio); cadfunc2 = new CadFunc("editar", linha, dataGridView1, inicio); crudfunc.MostrarEditar(linha, dataGridView1, cadfunc2); } }
private void btnEditar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocacao crudLocacao = new CrudLocacao(inicio); locacao = new Locacao(true, inicio); crudLocacao.mostrarEditar(this, locacao); } }
private void button5_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocacao crudLocacao = new CrudLocacao(inicio); locacaoDetalhe = new Locacao("Ok", inicio); crudLocacao.verDetalhe(this, locacaoDetalhe); } }
private void btnAddFiador_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { CrudLocacao crudLocacao = new CrudLocacao(inicio); DataGridViewRow selectedRow = dgvLocacoes.Rows[linha]; int id_Locacao = Convert.ToInt16(selectedRow.Cells[0].Value); fiadores2 = new verFiadores("OutroFiador", id_Locacao, usuario, inicio); crudLocacao.chamarFiadores(this, fiadores2); } }
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) { CrudFiador crudFiador = new CrudFiador(inicio); DataGridViewRow selectedRow = dgvFiadores.Rows[linha]; int id_Fiador = Convert.ToInt16(selectedRow.Cells[0].Value); fiadorEditar = new cadFiador(usuario, "editar", id_Fiador, inicio); crudFiador.mostrarEditar(this, fiadorEditar); } }
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 CadLocatario2_Load(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); validacaoGeral.tamanho(this); if (menuStrip) { btnLocatarios.Visible = true; } else { btnLocatarios.Visible = false; } }
private void btnEditar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.checarVazio(this); if (checar) { CrudAtendimento crudAtendimento = new CrudAtendimento(id_user, dataGrid, linha, inicio); crudAtendimento.editar(txtCliente, rtxtDescricao, id_user, dataGrid, linha); } else { MessageBox.Show("Campo(s) vazio(s)", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Atendimento_Load(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); validacaoGeral.tamanho(this); if (menuStrip) { CrudAtendimento crudAtendimento = new CrudAtendimento(inicio); String horaData = crudAtendimento.getData().ToString(); txtData.Text = horaData.Substring(0, 10); txtHorario.Text = horaData.Substring(11); } }
private void btnAddOutraFonte_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); if (checar) { DataGridViewRow selectedRow = dgvLocatario.Rows[linha]; int id_Locatario = Convert.ToInt16(selectedRow.Cells[0].Value); cadLocatario3 = new CadLocatario2("VerLocatario", id_Locatario, inicio); cadLocatario3.Visible = true; } }
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 CadLocatario_Load(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); validacaoGeral.tamanho(this); email = txtEmail.Text; cpf = mtxtCpf.Text; rg = mtxtRg.Text; if (editar == "Editar") { btnAvançar.Text = "Salvar"; btnAvançar.BackgroundImage = null; btnAvançar.TextAlign = ContentAlignment.MiddleCenter; } }
private void btnSalvar_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.checarCamposVazios(this); bool checar2 = validacaoGeral.validaSalario(txtSalarioBruto); if (checar && checar2) { CrudLocatario crudLocatario = new CrudLocatario(id_Locatario); if (verLocatario == "VerLocatario") { bool valCad = crudLocatario.cadastrarFonteDeRenda(id_Locatario, this); if (valCad) { validacaoGeral.limpar(this); } } else if (editar == "editar") { CrudFonteDeRenda crudFonte = new CrudFonteDeRenda(inicio); crudFonte.editar(this); } else { bool valCad = crudLocatario.cadastrarFonteDeRenda(this); if (valCad) { validacaoGeral.limpar(this); } } } else { if (!checar) { MessageBox.Show("Campo(s) vazio(s)", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (!checar2) { MessageBox.Show("O campo 'Salário Bruto' não foi preenchido corretamente", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
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; } }
//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); } }
//btnDeletar private void button1_Click(object sender, EventArgs e) { ValidacaoGeral validacaoGeral = new ValidacaoGeral(); bool checar = validacaoGeral.validaDatagrid(this); CrudFunc crudFunc = new CrudFunc(inicio); LoginSistema loginSistema = new LoginSistema(); // int id_funcLogado = loginSistema.getFuncByIdUser(usuario); int id_funcGrid = crudFunc.getIdFuncDoGrid(this); if (checar && (usuario != id_funcGrid)) { CrudFunc crudfunc = new CrudFunc(inicio); crudfunc.deletarUsuario(linha, dataGridView1); crudfunc.Deletar(linha, dataGridView1); } else if (usuario == id_funcGrid) { MessageBox.Show("Não é possível deletar um funcionário logado", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }