private void btnLoad_Click(object sender, EventArgs e) { try { if ((dtpDateStart.Value > DateTime.Now) || (dtpDateEnd.Value > DateTime.Now)) { MessageBox.Show("Please Select dates less then current date", "Wrong Date...", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (dtpDateEnd.Value < dtpDateStart.Value) { MessageBox.Show("From Date cannot be less then To Date", "Wrong Date...", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Form f = Application.OpenForms["FrmStock"]; if (f != null) { f.Close(); } FrmStock frmstk = new FrmStock(dtpDateStart.Value, dtpDateEnd.Value, _isPurchase); frmstk.MdiParent = this.MdiParent; frmstk.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void toolStripMenuItem3_Click(object sender, EventArgs e) { using (BeginWaitCursorBlock()) { Form f = Application.OpenForms["FrmStock"]; if (f != null) { f.Close(); } FrmStock stk = new FrmStock(false); stk.MdiParent = this; stk.Show(); } }