public void Edit() { DataTable dt = new DataTable(); dt = DoCadastros.Pagamento_ListaPorID(int.Parse(lblID.Text)); txtCadastro.Text = dt.Rows[0]["descricao"].ToString(); }
public void SaldoAnterior() { DataTable dt = new DataTable(); dt = DoCadastros.SaldoInicial_Lista(); DateTime data = new DateTime(); data = Convert.ToDateTime(dateEntrada.Value.ToString()); var saldoAnterior = dt.AsEnumerable().Where(x => x.Field <string>("data_entrada") == data.AddDays(-1).ToShortDateString()). Select(k => { var row = dt.NewRow(); row.ItemArray = new object[] { k.Field <decimal>("saldo_final") }; return(row); }); if (saldoAnterior.Any()) { DataTable dtResult = saldoAnterior.CopyToDataTable(); lblSaldoAnterior.Text = dtResult.Rows[0][0].ToString(); } else { lblSaldoAnterior.Text = "0"; } }
private void dgvParcelas_CellClick(object sender, DataGridViewCellEventArgs e) { string rpta = ""; string pago = ""; try { if (e.ColumnIndex == 0) { if (dgvParcelas.CurrentRow.Cells["status_pagamento"].Value.ToString() == "PENDENTE") { dgvParcelas.CurrentRow.Cells["pagamento"].Value = true; rpta = DoCadastros.Parcela_Update( Convert.ToInt32(dgvParcelas.CurrentRow.Cells["id"].Value.ToString()), Convert.ToInt32(Support.Enum.PagtoRec.Pago) ); } else if (dgvParcelas.CurrentRow.Cells["status_pagamento"].Value.ToString() == "PAGO") { rpta = DoCadastros.Parcela_Update( Convert.ToInt32(dgvParcelas.CurrentRow.Cells["id"].Value.ToString()), Convert.ToInt32(Support.Enum.PagtoRec.Pendente) ); } if (rpta.Equals("OK")) { pago = DoCadastros.PlanoContas_Cadastro ( dgvParcelas.CurrentRow.Cells["descricao"].Value.ToString(), Convert.ToDecimal(dgvParcelas.CurrentRow.Cells["valor"].Value.ToString()), Convert.ToDateTime(dgvParcelas.CurrentRow.Cells["DataPagamento"].Value.ToString()), Convert.ToInt32(Status.pago), Convert.ToInt32(lblFpagto.Text), "", dgvParcelas.CurrentRow.Cells["parcela"].Value.ToString(), Convert.ToInt32(lblEmpresa.Text), Convert.ToInt32(lblSucCat.Text), "" ); if (pago.Equals("OK")) { MessageBox.Show("Status alterado para PAGO"); } else { MessageBox.Show(pago); } } else { MessageBox.Show("não é possivel desfazer o pagamento (consulte o administrador do sistema)"); } ListarParcelas(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void btnSalvar_Click(object sender, EventArgs e) { try { string rpta = ""; if (string.IsNullOrEmpty(txtValor.Text)) { lblError.Visible = true; lblSuc.Visible = false; msgError("Campo não pode estar vazio!"); } else { rpta = DoCadastros.SaldoInicial_Cadastro(decimal.Parse(txtValor.Text), decimal.Parse(txtValor.Text), Convert.ToDateTime(dtData.Value.ToShortDateString())); if (rpta.Equals("OK")) { lblError.Visible = false; msgSuccess("Saldo Inicial " + txtValor.Text + ", cadastrado com sucesso!"); } else { msgError(rpta); } } } catch (Exception ex) { msgError(ex.Message + ex.StackTrace); } Lista(); txtValor.Clear(); txtValor.Focus(); }
public void ListRegistros() { dgvRegistros.DataSource = DoCadastros.CentroCusto_Lista(); dgvRegistros.Columns["descricao"].HeaderText = "Descrição"; dgvRegistros.Columns["id"].Visible = false; dgvRegistros.Columns["delete"].DisplayIndex = 2; }
private void dgvRegistros_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { string rpta = ""; try { if (MessageBox.Show("Excluir Registro?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { rpta = DoCadastros.TipoSaida_Delete(int.Parse(dgvRegistros.CurrentRow.Cells["id"].Value.ToString())); } else { // user clicked no } if (rpta.Equals("OK")) { MessageBox.Show("Entrada excluida com sucesso!"); } else { MessageBox.Show(rpta); } } catch (Exception ex) { rpta = ex.Message + ex.StackTrace; } ListRegistros(); } }
private void btnSaveSubCategoria_Click(object sender, EventArgs e) { string rpta = ""; try { if (string.IsNullOrEmpty(txtSubCategoria.Text)) { txtSubCategoria.BackColor = Color.Red; } else { rpta = DoCadastros.SubCategoria_Cadastro(txtSubCategoria.Text); } if (rpta.Equals("OK")) { txtSubCategoria.Clear(); pSubCategoria.Visible = false; ListSubCategoria(); } else { MessageBox.Show(rpta); } } catch (Exception ex) { rpta = ex.Message + ex.StackTrace; } }
private void dgvCadastros_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { string rpta = ""; try { if (MessageBox.Show("Excluir Tipo de pagamento?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { rpta = DoCadastros.TipoSaida_Delete(int.Parse(dgvCadastros.CurrentRow.Cells["id"].Value.ToString())); } else { // user clicked no } if (rpta.Equals("OK")) { lblError.Visible = false; msgSuccess("Cadastro excluido com sucesso!"); } else { msgError("Erro ao tentar excluir"); } } catch (Exception ex) { rpta = ex.Message + ex.StackTrace; } Lista(); } }
private void btnSalvar_Click(object sender, EventArgs e) { string rpta = ""; try { if (string.IsNullOrEmpty(txtValor.Text)) { MessageBox.Show("Campo valor não pode estar vazio!"); } else if (IsNew == true) { rpta = DoCadastros.PlanoContas_Cadastro ( txtDescricao.Text, Convert.ToDecimal(txtValor.Text), dateEntrada.Value, Convert.ToInt32(cbStatus.SelectedValue), Convert.ToInt32(cbPagamento.SelectedValue), txtDoc.Text, txtParcela.Text, Convert.ToInt32(cbEmpresa.SelectedValue), Convert.ToInt32(cbSubCategoria.SelectedValue), txtObservacao.Text ); } else if (IsNew == false) { rpta = DoCadastros.PlanoContas_Update ( Convert.ToInt32(lblID.Text), txtDescricao.Text, Convert.ToDecimal(txtValor.Text), dateEntrada.Value, Convert.ToInt32(cbStatus.SelectedValue), Convert.ToInt32(cbPagamento.SelectedValue), txtDoc.Text, txtParcela.Text, Convert.ToInt32(cbEmpresa.SelectedValue), Convert.ToInt32(cbSubCategoria.SelectedValue), txtObservacao.Text ); } if (rpta.Equals("OK") && IsNew == true) { msgSuccess("Cadastro REALIZADO com sucesso!"); } else { //msgError(rpta); msgSuccess("Cadastro ATUALIZADO com sucesso!"); } } catch (Exception ex) { msgError(ex.Message); } }
public void ListRegistros() { dgvRegistros.DataSource = DoCadastros.TipoSaida_Lista(); dgvRegistros.Columns["descricao"].HeaderText = "Descrição"; dgvRegistros.Columns["dinheiro"].HeaderText = "Espécie?"; dgvRegistros.Columns["id"].Visible = false; dgvRegistros.Columns["delete"].DisplayIndex = 3; }
public void Lista() { dgvCadastros.DataSource = DoCadastros.TipoSaida_Lista(); dgvCadastros.Columns["id"].Visible = false; dgvCadastros.Columns["descricao"].DisplayIndex = 0; dgvCadastros.Columns["descricao"].HeaderText = "Nome"; dgvCadastros.Columns["delete"].DisplayIndex = 2; dgvCadastros.Columns["delete"].HeaderText = "..."; dgvCadastros.Columns["delete"].Width = 50; }
public void Lista() { dgvCadastros.DataSource = DoCadastros.SaldoInicial_Lista(); dgvCadastros.Columns["id"].Visible = false; dgvCadastros.Columns["saldo_final"].Visible = false; dgvCadastros.Columns["saldo_inicial"].HeaderText = "Valor"; dgvCadastros.Columns["data_entrada"].HeaderText = "Data"; // dgvCadastros.Columns["saldo_inicial"].DisplayIndex = 0; dgvCadastros.Columns["data_entrada"].DisplayIndex = 1; }
public void Provisionados_Lista() { dgvLancamentos.DataSource = DoCadastros.Recorrencia_Lista(); dgvLancamentos.Columns["id"].Visible = false; dgvLancamentos.Columns["id_sub"].Visible = false; dgvLancamentos.Columns["id_emp"].Visible = false; dgvLancamentos.Columns["id_pagto"].Visible = false; dgvLancamentos.Columns["delete"].DisplayIndex = 12; CalculoTotais(); // dgvLancamentos.Columns["descricao"].HeaderText = "DESCRIÇÂO"; }
private void btnSalvar_Click(object sender, EventArgs e) { try { string rpta = ""; int Especie = 0; if (string.IsNullOrEmpty(txtCadastro.Text)) { lblError.Visible = true; lblSuc.Visible = false; msgError("Campo não pode estar vazio!"); } else { if (DoCadastros.TipoEntrada_Valida(txtCadastro.Text)) { lblSuc.Visible = false; lblError.Visible = true; msgError("Já existe um tipo de Entrada com descrição: " + txtCadastro.Text.Trim().ToUpper()); } else if (IsNew == true) { if (chkEspecie.Checked == true) { Especie = 1; } rpta = DoCadastros.TipoEntrada_Cadastro(txtCadastro.Text.Trim().ToUpper(), Especie); } else if (IsNew == false) { DoCadastros.TipoEntrada_Update(int.Parse(lblID.Text), txtCadastro.Text); } if (rpta.Equals("OK") && IsNew == true) { lblError.Visible = false; msgSuccess("Tipo de Entrada " + txtCadastro.Text.Trim().ToUpper() + ", cadastrado com sucesso!"); } else { msgSuccess("Tipo de Entrada " + txtCadastro.Text.Trim().ToUpper() + ", atualizado com sucesso!"); } } } catch (Exception ex) { msgError(ex.Message + ex.StackTrace); } txtCadastro.Clear(); chkEspecie.Checked = false; txtCadastro.Focus(); }
public void Edit() { DataTable dt = new DataTable(); dt = DoCadastros.Recorrencia_ListaPorID(int.Parse(lblID.Text)); dateEntrada.Value = Convert.ToDateTime(dt.Rows[0]["data_inicio"].ToString()); txtDescricao.Text = dt.Rows[0]["descricao"].ToString(); txtValor.Text = dt.Rows[0]["valor"].ToString(); cbRecorrencia.Text = dt.Rows[0]["tipo_recorrencia"].ToString(); txtParcelas.Text = dt.Rows[0]["parcelas"].ToString(); cbPagamento.Text = dt.Rows[0]["forma_pagamento"].ToString(); cbSubCategoria.Text = dt.Rows[0]["sub_categoria"].ToString(); cbEmpresa.Text = dt.Rows[0]["empresa"].ToString(); }
public void ListRegistros() { dgvRegistros.DataSource = DoCadastros.Categoria_Lista(); dgvRegistros.Columns["id"].Visible = false; dgvRegistros.Columns["descricao"].DisplayIndex = 1; dgvRegistros.Columns["descricao"].HeaderText = "Nome"; dgvRegistros.Columns["Expr1"].DisplayIndex = 2; dgvRegistros.Columns["Expr1"].HeaderText = "Centro de Custo"; dgvRegistros.Columns["Expr2"].DisplayIndex = 3; dgvRegistros.Columns["Expr2"].HeaderText = "Sub Categoria"; dgvRegistros.Columns["delete"].DisplayIndex = 4; dgvRegistros.Columns["delete"].HeaderText = "..."; dgvRegistros.Columns["delete"].Width = 50; }
private void btnFiltro_Click(object sender, EventArgs e) { var inicio = DateTime.Parse(dtInicio.Value.ToString()).ToShortDateString(); var fim = DateTime.Parse(dtFim.Value.ToString()).ToShortDateString(); if (string.IsNullOrEmpty(txtSearch.Text)) { dgvLancamentos.DataSource = DoCadastros.PlanoContas_FiltroDataSemDescricao(Convert.ToDateTime(inicio), Convert.ToDateTime(fim)); } else { dgvLancamentos.DataSource = DoCadastros.PlanoContas_FiltroData(Convert.ToDateTime(inicio), Convert.ToDateTime(fim), txtSearch.Text); } CalculoTotais(); }
public void Edit() { DataTable dt = new DataTable(); dt = DoCadastros.PlanoContas_ListaPorID(int.Parse(lblID.Text)); txtDescricao.Text = dt.Rows[0]["descricao"].ToString(); txtValor.Text = dt.Rows[0]["valor"].ToString(); txtDoc.Text = dt.Rows[0]["doc"].ToString(); txtParcela.Text = dt.Rows[0]["parcela"].ToString(); txtObservacao.Text = dt.Rows[0]["observacao"].ToString(); cbSubCategoria.Text = dt.Rows[0]["SubCategoria"].ToString(); cbEmpresa.Text = dt.Rows[0]["Empresa"].ToString(); cbPagamento.Text = dt.Rows[0]["Pagamento"].ToString(); cbStatus.Text = dt.Rows[0]["status"].ToString(); dateEntrada.Value = Convert.ToDateTime(dt.Rows[0]["data_pagamento"].ToString()); }
private void btnSalvar_Click(object sender, EventArgs e) { try { string rpta = ""; int Especie = 0; if (string.IsNullOrEmpty(txtCadastro.Text)) { lblError.Visible = true; lblSuc.Visible = false; msgError("Campo não pode estar vazio!"); } else { if (DoCadastros.Pagamento_Valida(txtCadastro.Text)) { lblSuc.Visible = false; lblError.Visible = true; msgError("Já existe registro com descrição: " + txtCadastro.Text.Trim().ToUpper()); } else if (IsNew == true) { rpta = DoCadastros.Pagamento_Cadastro(txtCadastro.Text.Trim().ToUpper()); } else if (IsNew == false) { DoCadastros.Pagamento_Update(int.Parse(lblID.Text), txtCadastro.Text); } if (rpta.Equals("OK") && IsNew == true) { lblError.Visible = false; msgSuccess("Registro " + txtCadastro.Text.Trim().ToUpper() + ", CADASTRADO com sucesso!"); } else { msgSuccess("Registro " + txtCadastro.Text.Trim().ToUpper() + ", ATUALIZADO com sucesso!"); } } } catch (Exception ex) { msgError(ex.Message + ex.StackTrace); } txtCadastro.Clear(); txtCadastro.Focus(); }
public void PlanoContas_Lista() { dgvLancamentos.DataSource = DoCadastros.PlanoContas_Lista(); dgvLancamentos.Columns["id"].Visible = false; CalculoTotais(); dgvLancamentos.Columns["descricao"].HeaderText = "DESCRIÇÂO"; dgvLancamentos.Columns["valor"].HeaderText = "VALOR"; dgvLancamentos.Columns["data_pagamento"].HeaderText = "DATA"; dgvLancamentos.Columns["status"].HeaderText = "STATUS"; dgvLancamentos.Columns["doc"].HeaderText = "DOC"; dgvLancamentos.Columns["parcela"].HeaderText = "PARCELA"; dgvLancamentos.Columns["observacao"].HeaderText = "OBS"; dgvLancamentos.Columns["Pagamento"].HeaderText = "F.PAGTO"; dgvLancamentos.Columns["Categoria"].HeaderText = "CATEGORIA"; dgvLancamentos.Columns["SubCategoria"].HeaderText = "SUBCATEGORIA"; dgvLancamentos.Columns["Empresa"].HeaderText = "EMPRESA"; dgvLancamentos.Columns["CentroCusto"].HeaderText = "C.CUSTO"; dgvLancamentos.Columns["delete"].DisplayIndex = 13; }
private void dgvLancamentos_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 9) { Parcelas frm = new Parcelas( dgvLancamentos.CurrentRow.Cells["id"].Value.ToString(), dgvLancamentos.CurrentRow.Cells["id_pagto"].Value.ToString(), dgvLancamentos.CurrentRow.Cells["id_sub"].Value.ToString(), dgvLancamentos.CurrentRow.Cells["id_emp"].Value.ToString() ); frm.ShowDialog(); } if (e.ColumnIndex == 0) { string rpta = ""; try { if (MessageBox.Show("Excluir Registro?", "Confirmar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { rpta = DoCadastros.Recorrencia_Delete(int.Parse(dgvLancamentos.CurrentRow.Cells["id"].Value.ToString())); } else { // user clicked no } if (rpta.Equals("OK")) { MessageBox.Show("Registro excluida com sucesso!"); } else { MessageBox.Show(rpta); } } catch (Exception ex) { rpta = ex.Message + ex.StackTrace; } Provisionados_Lista(); } }
private void btnSalvar_Click(object sender, EventArgs e) { string rpta = ""; try { rpta = DoCadastros.Categoria_Agrupamento(cbCategoria.Text, Convert.ToInt32(cbCentroCusto.SelectedValue), Convert.ToInt32(cbCategoria.SelectedValue), cbSubCategoria.Text); if (rpta.Equals("OK")) { msgSuccess("Cadastro realizado com sucesso!"); } else { msgError("Erro no cadastro"); } } catch (Exception ex) { rpta = ex.Message; } }
private void btnSalvar_Click(object sender, EventArgs e) { try { string rpta = ""; if (string.IsNullOrEmpty(txtCadastro.Text)) { lblError.Visible = true; lblSuc.Visible = false; msgError("Campo não pode estar vazio!"); } else { if (DoCadastros.CentroCusto_Valida(txtCadastro.Text)) { lblSuc.Visible = false; lblError.Visible = true; msgError("Já existe um Centro de Custo com descrição: " + txtCadastro.Text.Trim().ToUpper()); } else { rpta = DoCadastros.CentroCusto_Cadastro(txtCadastro.Text.Trim().ToUpper()); } if (rpta.Equals("OK")) { lblError.Visible = false; msgSuccess("Centro de Custo " + txtCadastro.Text.Trim().ToUpper() + ", cadastrado com sucesso!"); } } } catch (Exception ex) { msgError(ex.Message + ex.StackTrace); } Lista(); txtCadastro.Clear(); txtCadastro.Focus(); }
private void ListTipoRecorrencia() { cbRecorrencia.DataSource = DoCadastros.RecorrenciaTipo_Lista(); cbRecorrencia.ValueMember = "id"; cbRecorrencia.DisplayMember = "tipo_recorrencia"; }
public void ListSubCategoria() { cbSubCategoria.DataSource = DoCadastros.Categoria_ListaSubCategoria(); cbSubCategoria.ValueMember = "id"; cbSubCategoria.DisplayMember = "descricao"; }
public void ListCentroCusto() { cbCentroCusto.DataSource = DoCadastros.CentroCusto_Lista(); cbCentroCusto.ValueMember = "id"; cbCentroCusto.DisplayMember = "descricao"; }
public void Edit() { DataTable dt = new DataTable(); dt = DoCadastros.Categoria_ListaPorID(int.Parse(lblID.Text)); }
private void calendario_MonthChanged(object sender, Pabo.Calendar.MonthChangedEventArgs e) { //removendo os controles entrada foreach (Control item in painelEntradas.Controls.OfType <Panel>()) { painelEntradas.Controls.Clear(); } switch (e.Month) { case 1: lblMes.Text = "JANEIRO" + " / " + e.Year.ToString(); break; case 2: lblMes.Text = "FEVEREIRO" + " / " + e.Year.ToString(); break; case 3: lblMes.Text = "MARÇO" + " / " + e.Year.ToString(); break; case 4: lblMes.Text = "ABRIL" + " / " + e.Year.ToString(); break; case 5: lblMes.Text = "MAIO" + " / " + e.Year.ToString(); break; case 6: lblMes.Text = "JUNHO" + " / " + e.Year.ToString(); break; case 7: lblMes.Text = "JULHO" + " / " + e.Year.ToString(); break; case 8: lblMes.Text = "AGOSTO" + " / " + e.Year.ToString(); break; case 9: lblMes.Text = "SETEMBRO" + " / " + e.Year.ToString(); break; case 10: lblMes.Text = "OUTUBRO" + " / " + e.Year.ToString(); break; case 11: lblMes.Text = "NOVEMBRO" + " / " + e.Year.ToString(); break; case 12: lblMes.Text = "DEZEMBRO" + " / " + e.Year.ToString(); break; default: break; } DataTable dt = new DataTable(); dt = DoCadastros.PlanoContas_Consolidado(); var planoContas = dt.AsEnumerable().Where(x => x.Field <int>("Mes") == e.Month).Select(k => { var row = dt.NewRow(); row.ItemArray = new object[] { k.Field <string>("descricao"), k.Field <decimal>("Valor") }; return(row); }); if (planoContas.Any()) { DataTable dtResult = planoContas.CopyToDataTable(); for (int i = 0; i < dtResult.Rows.Count; i++) { Panel pResult = new Panel(); pResult.Name = "painelDinamico"; pResult.Width = 246; pResult.Height = 51; pResult.BorderStyle = BorderStyle.FixedSingle; pResult.Left = 3; pResult.Top = i * 54; pResult.BackColor = Color.WhiteSmoke; painelEntradas.Controls.Add(pResult); Label descricao = new Label(); descricao.AutoSize = true; descricao.Font = new Font("Microsoft Sans Serif", 7, FontStyle.Regular); descricao.ForeColor = Color.Black; decimal valor = Convert.ToDecimal(dtResult.Rows[i][1].ToString()); descricao.Text = dtResult.Rows[i][0].ToString() + ": " + valor.ToString("C"); descricao.Left = 3; descricao.Top = 15; pResult.Controls.Add(descricao); } } }
private void Listpagamento() { cbPagamento.DataSource = DoCadastros.Pagamento_Lista(); cbPagamento.ValueMember = "id"; cbPagamento.DisplayMember = "descricao"; }
private void ListTipoEntrada() { cbTipoEntrada.DataSource = DoCadastros.TipoEntrada_Lista(); cbTipoEntrada.ValueMember = "id"; cbTipoEntrada.DisplayMember = "descricao"; }