public static D_Summary Instance() { if (_instance == null) { _instance = new D_Summary(); } return(_instance); }
private void btnViewStock_Click(object sender, EventArgs e) { try { if (!panelMainContent.Controls.Contains(D_Summary.Instance())) { panelMainContent.Controls.Add(D_Summary.Instance()); D_Summary.Instance().Dock = DockStyle.Fill; D_Summary.Instance().BringToFront(); } else { D_Summary.Instance().BringToFront(); } } catch (Exception ex) { MetroMessageBox.Show(this, "System Error " + ex.Message, "MetroMessageBox", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void pictureBox2_Click(object sender, EventArgs e) { try { OutOfStoclIC.refresh(); D_Summary.Refresh(); panelMainContent.Controls.Remove(UserControlDashBoard.Refresh()); panelMainContent.Controls.Remove(D_Summary.Instance()); panelMainContent.Controls.Remove(OutOfStoclIC.Instance()); panelMainContent.Controls.Add(UserControlDashBoard.Refresh()); UserControlDashBoard.Refresh().Dock = DockStyle.Fill; UserControlDashBoard.Refresh().BringToFront(); } catch (Exception ex) { MetroMessageBox.Show(this, "System Error " + ex.Message, "MetroMessageBox", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void Refresh() { _instance = null; _instance = new D_Summary(); }