private void BtnInvoices_Click(object sender, EventArgs e) { //Off the visibility of the Button of see products BtnSeeProducts.Visible = false; Indicator8.Visible = false; //Relocate the Buttons and indicators BtnInvoices.Visible = true; BtnInvoices.Location = new System.Drawing.Point(661, 79); Indicator6.Location = new System.Drawing.Point(662, 115); BtnCustomers.Visible = true; BtnCustomers.Location = new System.Drawing.Point(767, 79); Indicator7.Location = new System.Drawing.Point(767, 115); BtnUserAccount.Visible = false; Indicator8.Visible = false; //Indicators Indicator1.Visible = false; //0 Indicator2.Visible = false; //0 Indicator3.Visible = true; //1 Indicator4.Visible = false; //0 Indicator5.Visible = false; Indicator6.Visible = true; Indicator7.Visible = false; //0 Frm2SavedInvoices SV = new Frm2SavedInvoices(); SV.TopLevel = false; Container1.Controls.Clear(); Container1.Controls.Add(SV); SV.BringToFront(); SV.Show(); }
public void RefreshInvoiceRecords() { Frm2SavedInvoices coms = new Frm2SavedInvoices(); // get the path of the image Image img = Image.FromFile(@"C:\Users\Arjie\source\repos\AHKPOSENKTHESIS MASTER\AHKPOSENKTHESIS WIP\AHKPOSENKTHESIS\bin\Debug\Icons\icons8-purchase-order-30.png"); int i = 0; coms.dataGridView1.Rows.Clear(); cn.Open(); cm = new SqlCommand("SELECT * FROM tblInvoiceRecords WHERE customer like '%" + coms.txtSearch.Text + "%' order by invoiceno desc", cn); dr = cm.ExecuteReader(); while (dr.Read()) { i++; coms.dataGridView1.Rows.Add(i, img, dr[0].ToString(), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), double.Parse(dr[4].ToString()).ToString("#,##0.00"), dr[5].ToString(), dr[6].ToString(), dr[7].ToString(), dr[8].ToString(), dr[9].ToString(), dr[10].ToString(), dr[11].ToString(), dr[12].ToString()); } dr.Close(); cn.Close(); }