private void btnok_Click(object sender, EventArgs e) { if ((txtvalor.Text == "") || (comboforma.Text == "") || (txtdesconto.Text == "")) { MessageBox.Show("Campos com preenchimento obrigatório"); } else { Clnfecharvenda fec = new Clnfecharvenda(); if (txtcod_fecharvenda.Text != "") { fec.CodVenda = Convert.ToInt32(txtcod_fecharvenda.Text); fec.ValorTotal = Convert.ToDouble(txtvalor.Text); fec.Desconto = Convert.ToDouble(txtdesconto.Text); fec.Forma_pag = comboforma.Text; fec.Parcelas = comboparcelas.Text; fec.Valor_pago = Convert.ToDouble(txtvalor_pago.Text); fec.Valor_restante = Convert.ToDouble(txtvalor_restante.Text); fec.Troco = Convert.ToDouble(txttroco.Text); fec.Datadehoje = datafechar.Text; } if (ObjOperacao == clnFuncoesGerais.Operacao.Inclusao) { fec.Gravar(); MessageBox.Show("VENDA FECHADA COM SUCESSO!!", " " + txtcod_fecharvenda.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } Close(); } }
public void carregarDataGrid() { Clnfecharvenda ObjAgenda = new Clnfecharvenda(); dgvrelatorio.DataSource = ObjAgenda.Listar(datarela.Text).Tables[0]; dgvrelatorio.Columns[8].Visible = false; dgvrelatorio.Columns[0].HeaderText = ("ValorTotal"); dgvrelatorio.Columns[1].HeaderText = ("CodVenda"); dgvrelatorio.Columns[2].HeaderText = ("Desconto"); dgvrelatorio.Columns[3].HeaderText = ("Forma_pag"); dgvrelatorio.Columns[4].HeaderText = ("Parcelas"); dgvrelatorio.Columns[5].HeaderText = ("Valor_pago"); dgvrelatorio.Columns[6].HeaderText = ("Valor_restante"); dgvrelatorio.Columns[7].HeaderText = ("Troco"); dgvrelatorio.Columns[8].HeaderText = ("Datadehoje"); dgvrelatorio.AutoResizeColumns(); }