private void DeleteTimeSlip(appDB.TimeSlipRow actr) { if (UIHelper.ConfirmDelete()) { atriumBE.FileManager FMActivityTime = FM.AtMng.GetFile(actr.FileId); FMActivityTime.GetActivity().Load(actr.ActivityId); atriumDB.ActivityTimeRow atr = FMActivityTime.GetActivityTime().Load(actr.ActivityTimeId); Application.UseWaitCursor = true; atr.Delete(); actr.Delete(); try { atLogic.BusinessProcess bp = FMActivityTime.GetBP(); bp.AddForUpdate(FMActivityTime.GetActivityTime()); bp.Update(); if (CurrentRowSRP().IsSRPSubmittedDateNull()) { CalculateOpenPeriodTotals(CurrentRowSRP()); } } catch (Exception x1) { FMActivityTime.DB.ActivityTime.RejectChanges(); throw x1; } finally { Application.UseWaitCursor = false; } } }
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); } }