private void faturamentoToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Form Faturamento = new frmVendas();

            Faturamento.MdiParent = this;
            Faturamento.Show();
        }
Esempio n. 2
0
        private void frmVendasRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmVendas frm = new frmVendas();

            frm.Show();
        }
Esempio n. 3
0
 private void dataGridView2_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         DataGridViewRow dr = dataGridView2.SelectedRows[0];
         this.Hide();
         frmVendas Vendas = new frmVendas();
         // or simply use column name instead of index
         // dr.Cells["id"].Value.ToString();
         Vendas.Show();
         Vendas.txtNumPedido.Text      = dr.Cells[0].Value.ToString();
         Vendas.dtpDataPedido.Text     = dr.Cells[1].Value.ToString();
         Vendas.txtSubTotal.Text       = dr.Cells[2].Value.ToString();
         Vendas.txtTaxPer.Text         = dr.Cells[3].Value.ToString();
         Vendas.txtTaxAmt.Text         = dr.Cells[4].Value.ToString();
         Vendas.txtDescontoPer.Text    = dr.Cells[5].Value.ToString();
         Vendas.txtDescontoAmount.Text = dr.Cells[6].Value.ToString();
         Vendas.txtTotal.Text          = dr.Cells[7].Value.ToString();
         Vendas.txtTotalPago.Text      = dr.Cells[8].Value.ToString();
         Vendas.txtValorDevido.Text    = dr.Cells[9].Value.ToString();
         Vendas.txtObservacoes.Text    = dr.Cells[10].Value.ToString();
         Vendas.btnAtualizar.Enabled   = true;
         Vendas.btnDeletar.Enabled     = true;
         Vendas.btnPrint.Enabled       = true;
         Vendas.btnSalvar.Enabled      = false;
         con = new SqlConnection(cs.DBConn);
         con.Open();
         cmd = new SqlCommand("SELECT Product.ProductID,ProductSold.Productname,ProductSold.Price,ProductSold.Quantity,ProductSold.TotalAmount from Invoice_Info,ProductSold,Product where Invoice_info.InvoiceNo=ProductSold.InvoiceNo and Product.ProductID=ProductSold.ProductID and invoice_Info.InvoiceNo='" + dr.Cells[0].Value.ToString() + "'", con);
         rdr = cmd.ExecuteReader();
         while (rdr.Read() == true)
         {
             ListViewItem lst = new ListViewItem();
             lst.SubItems.Add(rdr[0].ToString().Trim());
             lst.SubItems.Add(rdr[1].ToString().Trim());
             lst.SubItems.Add(rdr[2].ToString().Trim());
             lst.SubItems.Add(rdr[3].ToString().Trim());
             lst.SubItems.Add(rdr[4].ToString().Trim());
             Vendas.listView1.Items.Add(lst);
         }
         Vendas.listView1.Enabled          = false;
         Vendas.btnIncluirCarrinho.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }