private void btnNew_Click(object sender, EventArgs e) { pnlAll.Closed = true; pnlParticipant.Closed = true; pnlNewCoontact.Closed = false; btnAddAddress.Visible = false; if (currentContactId != null && currentContactId.GetType() == typeof(int)) { cr = fmNew.DB.Contact.FindByContactId((int)currentContactId); ar = fmNew.DB.Address.FindByAddressId(cr.AddressCurrentID); cr.RejectChanges(); ar.RejectChanges(); } cr = (lmDatasets.atriumDB.ContactRow)fmNew.GetPerson().Add(null); ar = (lmDatasets.atriumDB.AddressRow)fmNew.GetAddress().Add(cr); cr.ContactClass = "P"; cr.AddressCurrentID = ar.AddressId; contactBindingSource.Filter = "ContactId=" + cr.ContactId.ToString(); addressBindingSource.Filter = "Addressid=" + ar.AddressId.ToString(); //contactBindingSource.DataSource = fmNew.DB.Contact.Select("", "", DataViewRowState.Added); //addressBindingSource.DataSource = fmNew.DB.Address.Select("", "", DataViewRowState.Added); fmNew.GetPerson().Validate(cr); fmNew.GetAddress().Validate(ar); SelectedContactId = cr.ContactId; }
private void AddAttendeeToTimeline(TimeLineField ContactField, atriumDB.AttendeeRow atr) { var fcx = from fc in myFM.DB.FileContact where fc.ContactId == atr.ContactId select fc; if (fcx.Count() == 1) { atriumDB.FileContactRow fcr = fcx.Single(); ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, fcr.DisplayName, 0)); } else { atriumDB.ContactRow cr = myFM.GetPerson().Load(atr.ContactId); ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, cr.DisplayName, 0)); //TODO find contact } myFM.GetAppointment().LoadByContactIdDates(atr.ContactId, RangeStartDate, RangeEndDate); AddDummyAppointmentForFileContacts(atr); }
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); } }