private void goToUcProduct() { if (!frmDashboard.Instance.MetroContainer.Controls.ContainsKey("ucProduct")) { ucProduct uc = new ucProduct(); uc.setAllProduct(frmDashboard.Instance.Products, true); uc.Dock = DockStyle.Fill; frmDashboard.Instance.MetroContainer.Controls.Add(uc); } else { ucProduct uc = (frmDashboard.Instance.MetroContainer.Controls["ucProduct"]) as ucProduct; uc.setAllProduct(frmDashboard.Instance.Products, false); } frmDashboard.Instance.MetroContainer.Controls["ucProduct"].BringToFront(); frmDashboard.Instance.MetroBack.Visible = true; frmDashboard.Instance.setPage("ucSale"); }
private void mtProduct_Click(object sender, EventArgs e) { if (!frmDashboard.Instance.MetroContainer.Controls.ContainsKey("ucProduct")) { ucProduct uc = new ucProduct(); uc.setAllProduct(frmDashboard.Instance.Products, true); uc.Dock = DockStyle.Fill; frmDashboard.Instance.MetroContainer.Controls.Add(uc); } else { if (frmDashboard.Instance.refreshData) { ucProduct uc = (frmDashboard.Instance.MetroContainer.Controls["ucProduct"]) as ucProduct; uc.setAllProduct(frmDashboard.Instance.Products, false); } } frmDashboard.Instance.refreshData = false; frmDashboard.Instance.MetroContainer.Controls["ucProduct"].BringToFront(); frmDashboard.Instance.MetroBack.Visible = true; frmDashboard.Instance.setPage("ucDashboard"); }