private void newToolStripMenuItem_Click(object sender, EventArgs e) { try { if (!IsList) { if (objUIRights.AddRight) { Appointment objAppoint; frmAppointmentProp objFrmProp; objAppoint = new Appointment(); objFrmProp = new frmAppointmentProp(objAppoint, objCurUser); objFrmProp.IsNew = true; objFrmProp.MdiParent = this.MdiParent; objFrmProp.Entry_DataChanged += new frmAppointmentProp.AppointUpdateHandler(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 (lvwAppoints.SelectedItems != null && lvwAppoints.SelectedItems.Count != 0) { if (IsList) { btnOk_Click(sender, e); } else { if (objUIRights.ModifyRight) { Appointment objAppoint; frmAppointmentProp objFrmProp; objAppoint = AppointmentManager.GetItem(Convert.ToInt32(lvwAppoints.SelectedItems[0].Name)); objFrmProp = new frmAppointmentProp(objAppoint, objCurUser); objFrmProp.MdiParent = this.MdiParent; objFrmProp.Entry_DataChanged += new frmAppointmentProp.AppointUpdateHandler(Entry_DataChanged); objFrmProp.Show(); } else { throw new Exception("Not Authorised."); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }