public frmFinancas() { InitializeComponent(); this.grdContasPagar.CellMouseClick += new DataGridViewCellMouseEventHandler(grdContasPagar_CellMouseClick); c.fillCombo(cboTipo, "select id, descricao from tipo_contas_pagar", "id", "descricao"); cboTipo.SelectedIndex = -1; PreencheCboMes(cboMes); CboSelMes = int.Parse(DateTime.Now.Month.ToString()); cboMes.SelectedValue = CboSelMes; PreencheCboAno(cboAno); CboSelAno = DateTime.Now.Year.ToString(); cboAno.SelectedText = CboSelAno; //isso preenche o grid contas a pagar: button1_Click(new Object(), new EventArgs()); //botao OK -> seleciona periodo grdContasPagar.ClearSelection(); grdOutrosValores.CellMouseClick += new DataGridViewCellMouseEventHandler(grdOutrosValores_CellMouseClick); //aba funcionarios c.fillCombo(cboCargo, "select id, descricao from cargos_func", "id", "descricao"); cboCargo.SelectedIndex = -1; txtSalario.LostFocus += new EventHandler(txtSalario_LostFocus); tabContas.SelectedIndexChanged += new EventHandler(tabContas_SelectedIndexChanged); this.grdFuncionarios.CellMouseClick += new DataGridViewCellMouseEventHandler(grdFuncionarios_CellMouse); //aba despesas gerais grdDespesasGerais.CellMouseClick += new DataGridViewCellMouseEventHandler(grdDespesasGerais_CellMouseClick); }
private void tabCad_SelectedIndexChanged(Object sender, EventArgs e) { switch ((sender as TabControl).SelectedIndex) { case 1: conexao c = new conexao(); c.fillCombo(this.cboProcurarProduto, "select * from produto", "id", "descr"); cboProcurarProduto.Text = ""; break; } }
public frmCreditoCli() { InitializeComponent(); c.fillCombo(this.txtNomeCli, "select * from clientes order by nome", "id", "nome"); txtNomeCli.SelectedValue = 0; chkDebito.Visible = false; //nao esta sendo usado.. criei e o perdi na tela.. to usando o chkDebito_ c.fillCboTicket(cboTickets); btnDelItem.Enabled = false; btnDelItem.Visible = false; }
private void btnSalvar_Click(object sender, EventArgs e) { if (!clicouEditar) { c.ExecutaQuery("insert into tipo_contas_pagar values('" + txtTipoConta.Text.ToString() + "')"); PreencheGrid(); } else { c.ExecutaQuery("update tipo_contas_pagar set descricao='" + txtTipoConta.Text.ToString() + "' where id=" + dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()); PreencheGrid(); } if (cboTp != null) { c.fillCombo(cboTp, "select id, descricao from tipo_contas_pagar", "id", "descricao"); cboTp.SelectedIndex = -1; } //... btnDeletar.Enabled = false; btnEditar.Enabled = false; clicouEditar = false; txtTipoConta.Text = ""; }
public frmCadastro(int idprod = 0) { InitializeComponent(); this.ActiveControl = txtNewNome; this.txtNewNome.Focus(); this.tabCad.SelectedIndexChanged += new EventHandler(tabCad_SelectedIndexChanged); conexao c = new conexao(); if (idprod != 0) { this.tabCad.SelectedIndex = 1; c.fillCombo(this.cboProcurarProduto, "select * from produto", "id", "descr"); cboProcurarProduto.SelectedValue = idprod; this.btnEditar_Click(null, null); } }
private void btnDel_Click(object sender, EventArgs e) { conexao Con = new conexao(); String sQuery; sQuery = "delete from produto where id=" + cboProcurarProduto.SelectedValue.ToString(); if (MessageBox.Show("Tem certeza que deseja DELETAR ?", "Deletar?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information) == DialogResult.Yes) { Con.ExecutaQuery(sQuery); btnLimpar2_Click(sender, e); btnDel.Enabled = false; Con.fillCombo(this.cboProcurarProduto, "select * from produto", "id", "descr"); } }
public frmConsulta() { InitializeComponent(); conexao c = new conexao(); c.fillCombo(this.cboConsulta, "select id, descr from produto", "id", "descr"); this.cboConsulta.SelectedIndex = -1; this.grdConsulta.DoubleClick += new EventHandler(edita_produto_from_consultaForm); this.cboConsulta.KeyDown += new KeyEventHandler(cboConsulta_KeyDown); this.grdConsultaVendas.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.grdConsultaVendas.MultiSelect = false; //this.grdConsultaVendas.DoubleClick += new EventHandler(abreProduto); grdConsultaVendas.DoubleClick += new EventHandler(abreProduto); }
public ExtratoCreditoCli() { InitializeComponent(); c.fillCombo(this.txtNomeCli, "select * from clientes order by nome", "id", "nome"); txtNomeCli.SelectedValue = 0; }