Exemplo n.º 1
0
 private void comboBoxigreja_SelectedIndexChanged(object sender, EventArgs e)
 {
     CaixaNegocio caixa = new CaixaNegocio();
     IgrejaNegocio igreja = new IgrejaNegocio();
     EntradaNegocio entrada = new EntradaNegocio();
     SaidaNegocio saida = new SaidaNegocio();
     textBoxcaixa.Text = caixa.Buscarvalorcorrente(igreja.Buscar(comboBoxigreja.Text.ToString()).Cod_igreja1).ToString();
     textBoxentrada.Text = entrada.Buscarultimanetrada(igreja.Buscar(comboBoxigreja.Text.ToString()).Cod_igreja1).ToString();
     textBoxsaida.Text = saida.Buscarultimasaida(igreja.Buscar(comboBoxigreja.Text.ToString()).Cod_igreja1).ToString();
 }
Exemplo n.º 2
0
 private void salvar_TelaRegistrarEntrada_botao_Click(object sender, EventArgs e)
 {
     if (tipo_TelaRegistrarEntrada_textbox.Text == "" || valor_TelaRegistrarEntrada_textbox.Text =="")
     {
         MessageBox.Show("Por favor, insira TIPO E VALOR");
     }
     else
     {
         IgrejaNegocio igreja = new IgrejaNegocio();
         EntradaNegocio entrada = new EntradaNegocio();
         CaixaNegocio caixa = new CaixaNegocio();
         entrada.Insert(entrada.fromaentrada(tipo_TelaRegistrarEntrada_textbox.Text, float.Parse(valor_TelaRegistrarEntrada_textbox.Text), DateTime.Today.Date, igreja.Buscar(igreja_TelaRegistrarEntrada_Textbox.Text).Cod_igreja1));
         caixa.Insert_entrada(igreja.Buscar(igreja_TelaRegistrarEntrada_Textbox.Text).Cod_igreja1,float.Parse(valor_TelaRegistrarEntrada_textbox.Text),caixa.Buscarvalorcorrente(igreja.Buscar(igreja_TelaRegistrarEntrada_Textbox.Text).Cod_igreja1),DateTime.Today.Date);
         limpacampos();
         MessageBox.Show("Entrada Inserida");
     }
 }
Exemplo n.º 3
0
 private void salvar_TelaRegistrarSaida_botao_Click(object sender, EventArgs e)
 {
     if (fornecedor_TelaRegistrarSaida_Textbox.Text == "" || igreja_TelaRegistrarSaida_Textbox.Text == "" || valor_TelaRegistrarSaida_textbox.Text == "" ||tiposaidacombobox.Text == "")
     {
         MessageBox.Show("Por favor, preencha todos os dados!");
     }
     else
     {
         IgrejaNegocio igreja = new IgrejaNegocio();
         FornecedorNegocio fornec = new FornecedorNegocio();
         SaidaNegocio saida = new SaidaNegocio();
         CaixaNegocio caixa = new CaixaNegocio();
         saida.Insert(saida.montarsaida(fornec.Buscar(fornecedor_TelaRegistrarSaida_Textbox.Text.ToString()).Cod_Fornecedor1, igreja.Buscar(igreja_TelaRegistrarSaida_Textbox.Text.ToString()).Cod_igreja1, float.Parse(valor_TelaRegistrarSaida_textbox.Text.ToString()), tiposaidacombobox.Text.ToString(), DateTime.Today.Date));
         caixa.Insert_saida(igreja.Buscar(igreja_TelaRegistrarSaida_Textbox.Text).Cod_igreja1, float.Parse(valor_TelaRegistrarSaida_textbox.Text),caixa.Buscarvalorcorrente(igreja.Buscar(igreja_TelaRegistrarSaida_Textbox.Text).Cod_igreja1), DateTime.Today.Date);
         limparcampos();
         MessageBox.Show("Saída Inserida com sucesso!");
     }
 }
Exemplo n.º 4
0
        private void salvar_TelaCadastrarMembro_botao_Click(object sender, EventArgs e)
        {
            if (cpf_TelaCadastrarMembro_texbox.Text == string.Empty || nome_TelaCadastrarMembro_texbox.Text == string.Empty || sexo_TelaCadastrarMembro_texbox.Text == string.Empty ||rg_TelaCadastrarMembro_texbox.Text == string.Empty || telefone_TelaCadastrarMembro_texbox.Text == string.Empty || comboboxCargo.Text == string.Empty || logradouro_TelaCadastrarMembro_textbox.Text == string.Empty|| comboBoxbairro.Text == string.Empty || comboBoxCidade.Text == string.Empty || comboBoxestado.Text == string.Empty||comboBoxpais.Text == string.Empty || cep_TelaCadastrarMembro_textbox.Text == string.Empty|| numero_TelaCadastrarMembro_texbox.Text == string.Empty|| comboBoxIgreja.Text == string.Empty)
            {
                MessageBox.Show("Favor preencher todos os dados");
            }
            else

            {
                this.Cursor = Cursors.WaitCursor;
                BairroNegocio bairro = new BairroNegocio();
                EnderecoNegocio endereco = new EnderecoNegocio();
                CargoNegocio cargo = new CargoNegocio();
                MembroNegocio membro = new MembroNegocio();
                IgrejaNegocio igreja = new IgrejaNegocio();
                long cpf = Convert.ToInt64(cpf_TelaCadastrarMembro_texbox.Text.ToString());
                long telefone = Convert.ToInt64(telefone_TelaCadastrarMembro_texbox.Text.ToString());
                if (membro.confereCPFexistente(cpf) == true)
                {
                    endereco.Insert(endereco.alt_end(bairro.Buscar(comboBoxbairro.Text.ToString()).Cod_Bairro, 2, logradouro_TelaCadastrarMembro_textbox.Text.ToString(), numero_TelaCadastrarMembro_texbox.Text.ToString(), Convert.ToInt32(cep_TelaCadastrarMembro_textbox.Text.ToString())));
                    membro.Insert(cargo.Buscar(comboboxCargo.Text.ToString()), endereco.BuscarComBairro(logradouro_TelaCadastrarMembro_textbox.Text.ToString(), bairro.Buscar(comboBoxbairro.Text.ToString()).Cod_Bairro), nome_TelaCadastrarMembro_texbox.Text.ToString(), dt_nascimento.Value.Date, cpf, Convert.ToInt32(rg_TelaCadastrarMembro_texbox.Text.ToString()), DateTime.Today.Date, dt_batismo.Value.Date, telefone, 1, sexo_TelaCadastrarMembro_texbox.Text.ToString());
                    igreja.associamembro(igreja.Buscar(comboBoxIgreja.Text.ToString()).Cod_igreja1, membro.buscaporcpf(Convert.ToInt64(cpf_TelaCadastrarMembro_texbox.Text.ToString())).Cod_Membro1);
                    this.Cursor = Cursors.Default;
                    limparTextBoxes();
                    MessageBox.Show("Cadastro Realizado!");
                }
                else
                {
                    MessageBox.Show("CPF já cadastrado no sistema!");
                }
            }
        }