private void btnAddIssue_Click(object sender, EventArgs e) { try { SST.SSTCaseRow sstR = SSTM.DB.SSTCase[0]; if (SSTM.GetSSTCaseMatter().CanAdd(sstR)) { lmDatasets.SST.SSTCaseMatterRow SSTMNewRow = (lmDatasets.SST.SSTCaseMatterRow)SSTM.GetSSTCaseMatter().Add(sstR); atriumDB.FileContactRow FCR = myFM.GetFileContact().GetByRole("FTM"); if (promptIssueMode || promptNoIssueMode || (FCR != null && FM.AtMng.WorkingAsOfficer.ContactId == FCR.ContactId)) { SSTMNewRow.ConfirmedByMemberId = FM.AtMng.WorkingAsOfficer.ContactId; } sSTCaseMatterBindingSource.Position = sSTCaseMatterBindingSource.Find("SSTCaseMatterId", SSTMNewRow.SSTCaseMatterId); this.ucIssueSelectBoxRF1.OpenBrowseIssueDialog(); OnValidated(new EventArgs()); } SetYesNoButtons(); } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "tsCopyPrefs": fContactSelect fcs = new fContactSelect(FM, null, false); if (fcs.ShowDialog() == DialogResult.OK) { officeDB.OfficerRow fromR = FM.LeadOfficeMng.GetOfficer().FindLoad(fcs.ContactId); if (MessageBox.Show("Are you sure you want to copy all the preferences from " + fromR.DisplayName + " to " + CurrentRow().DisplayName + "?", "Copy Preferences", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { int fromOfficer = fcs.ContactId; FM.LeadOfficeMng.GetOfficer().CopyPreferences(fromOfficer, CurrentRow().OfficerId, true); atLogic.BusinessProcess bp1 = FM.GetBP(); bp1.AddForUpdate(FM.LeadOfficeMng.DB.OfficerPrefs); bp1.Update(); } } break; case "cmdAddToAB": atriumBE.FileManager fmAB = FM.AtMng.GetFile(FM.AtMng.WorkingAsOfficer.MyFileId); try { fmAB.GetFileContact().Add(CurrentRow(), "FAB"); atLogic.BusinessProcess bp = fmAB.GetBP(); bp.AddForUpdate(fmAB.GetFileOffice()); bp.AddForUpdate(fmAB.GetPerson()); bp.AddForUpdate(fmAB.GetFileContact()); bp.AddForUpdate(fmAB.EFile); bp.Update(); } catch (Exception x) { fmAB.DB.RejectChanges(); throw x; } break; case "tsMyFile": if (CurrentRow().IsMyFileIdNull() || (!CurrentRow().IsMyFileIdNull() && MessageBox.Show(LawMate.Properties.Resources.PersonalFileAlreadyExists, LawMate.Properties.Resources.CreatePersonalFile, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)) { fBrowse f = new fBrowse(FM.AtMng, FM.CurrentFile.FileId, true, true, true, true); if (f.ShowDialog() == DialogResult.OK) { FM.LeadOfficeMng.GetOfficer().CreatePersonalFiles(f.SelectedFile.FileId, CurrentRow(), LawMate.Properties.Settings.Default.UseSeparatePersonalFiles); Save(); } } break; case "tsSave": Save(); break; case "tsDelete": Delete(); break; case "tsAudit": fData fAudit = new fData(CurrentRow()); fAudit.Show(); break; case "tsNew": //officerBindingSource.AddNew(); officeDB.OfficerRow or = (officeDB.OfficerRow)FM.LeadOfficeMng.GetOfficer().Add(FM.LeadOfficeMng.CurrentOffice); officerBindingSource.Position = officerBindingSource.Find("OfficerId", or.OfficerId); break; case "tsOfficeMailView": FileForm().MainForm.OpenBFList(CurrentRow()); break; case "tsOfficerBFList": FileForm().MainForm.OpenBFList(CurrentRow()); break; case "tsResetPassword": break; case "tsGroupBy": if (e.Command.Checked == Janus.Windows.UI.InheritableBoolean.True) { officerGridEX.GroupByBoxVisible = true; } else { officerGridEX.GroupByBoxVisible = false; } break; case "tsFilter": if (e.Command.Checked == Janus.Windows.UI.InheritableBoolean.True) { officerGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic; } else { officerGridEX.FilterMode = Janus.Windows.GridEX.FilterMode.None; } break; case "tsSecurity": Save(); fSecurity fs = new fSecurity(); fs.Init(FM.AtMng.SecurityManager, CurrentRow()); fs.ShowDialog(); Save(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }