private void CloseDealerProfile_Click(object sender, EventArgs e) { dashboardpanel.Hide(); BillViewContainer.Hide(); AmountPayment.Hide(); SearchPanel.Visible = true; SearchPanel.BringToFront(); if (f1 != null && !f1.IsDisposed) { f1.Close(); f1.Hide(); f1.Dispose(); f1 = null; } if (f2 != null && !f2.IsDisposed) { f2.Close(); f2.Hide(); f2.Dispose(); f2 = null; } if (f3 != null && !f3.IsDisposed) { f3.Close(); f3.Hide(); f3.Dispose(); f3 = null; } if (f4 != null && !f4.IsDisposed) { f4.Close(); f4.Hide(); f4.Dispose(); f4 = null; } }
private void DataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) {//start from here .... if (e.ColumnIndex == 1) { if (p1.GetDealer.dealertype == "Embroidery Dealer") { try { string billno = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); EmbroideryBillView view = new EmbroideryBillView(p1.LoadPrevoiusEmbdDealerBill(billno), p1.LoadEmbroideryOrderTransactiondetails(billno)); this.WindowState = FormWindowState.Maximized; BillViewContainer.Controls.Add(view); view.Dock = DockStyle.Fill; BillViewContainer.Dock = DockStyle.Fill; BillViewContainer.Show(); BillViewContainer.BringToFront(); } catch (NullReferenceException) { } } else if (p1.GetDealer.dealertype == "Calendaring Dealer") { try { string billno = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); CalendarBillView view = new CalendarBillView(p1.LoadPrevoiusCalendarDealerBill(billno), p1.LoadCalendarOrderTransactionDetails(billno)); this.WindowState = FormWindowState.Maximized; BillViewContainer.Controls.Add(view); view.Dock = DockStyle.Fill; BillViewContainer.Show(); BillViewContainer.BringToFront(); } catch (NullReferenceException) { } } else if (p1.GetDealer.dealertype == "Stitching Dealer") { try { string billno = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); StitchingBillVIew view = new StitchingBillVIew(p1.LoadPrevoiusStitchingDealerBill(billno), p1.LoadStitchingOrderTransactionDetails(billno)); this.WindowState = FormWindowState.Maximized; BillViewContainer.Controls.Add(view); view.Dock = DockStyle.Fill; BillViewContainer.Show(); BillViewContainer.BringToFront(); } catch (NullReferenceException) { } } else if (p1.GetDealer.dealertype == "Shipment Dealer") { try { string billno = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); ShipmentBillView view = new ShipmentBillView(p1.LoadPrevoiusShipmentDealerBill(billno), p1.LoadShipmentOrderTransaction(billno)); this.WindowState = FormWindowState.Maximized; BillViewContainer.Controls.Add(view); view.Dock = DockStyle.Fill; BillViewContainer.Show(); BillViewContainer.BringToFront(); } catch (NullReferenceException) { } } } }