private void newToolStripMenuItem_Click(object sender, EventArgs e) { try { if (!IsList) { if (objUIRights.AddRight) { ReturnableDC objDC; frmReturnableDCProp objFrmProp; objDC = new ReturnableDC(); objFrmProp = new frmReturnableDCProp(objDC, currentUser); objFrmProp.IsNew = true; objFrmProp.MdiParent = this.MdiParent; objFrmProp.Entry_DataChanged += new frmReturnableDCProp.DCUpdateHandler(Entry_DataChanged); objFrmProp.Show(); } else { throw new Exception("Not Authorised."); } } } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void modifyToolStripMenuItem_Click(object sender, EventArgs e) { try { if (lvwDCList.SelectedItems != null && lvwDCList.SelectedItems.Count != 0) { if (IsList) { btnOk_Click(sender, e); } else { if (objUIRights.ModifyRight) { ReturnableDC objDC; frmReturnableDCProp objFrmProp; objDC = ReturnableDCManager.GetItem(Convert.ToInt32(lvwDCList.SelectedItems[0].Name), true); objFrmProp = new frmReturnableDCProp(objDC, currentUser); objFrmProp.MdiParent = this.MdiParent; objFrmProp.Entry_DataChanged += new frmReturnableDCProp.DCUpdateHandler(Entry_DataChanged); objFrmProp.Show(); } else { throw new Exception("Not Authorised."); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }