Beispiel #1
0
        private void editBox1_ButtonClick(object sender, EventArgs e)
        {
            try
            {
                if (myWLQuery == WorkloadQuery.NotApplicable)
                {
                    fContactSelect f = new fContactSelect(FM, null, true);
                    f.ShowDialog();

                    if (f.ContactId != 0)
                    {
                        isChanged = true;
                        ContactId = f.ContactId;
                    }
                    f.Close();
                }
                else
                {
                    fWorkloadView fWL = new fWorkloadView(WLQuery, true, FM, ContactId);
                    fWL.ShowDialog();

                    if (fWL.SelectedContactId != 0)
                    {
                        isChanged = true;
                        ContactId = fWL.SelectedContactId;
                    }
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Beispiel #2
0
        private void AddRecip()
        {
            int            id = 0;
            fContactSelect f  = new fContactSelect(FM, null, true, true, true);

            if (f.ShowDialog() == DialogResult.OK)
            {
                id = f.ContactId;
                SST.SSTReqRecipientRow rrr = (SST.SSTReqRecipientRow)SSTM.GetSSTReqRecipient().Add(CurrentRow());

                rrr.SentToContactId = id;

                FM.SaveAll();
            }
        }
Beispiel #3
0
        private void AddAttendee()
        {
            fContactSelect f = new fContactSelect(myFM, null, true);

            f.ShowDialog();

            if (f.ContactId != 0)
            {
                //if contact is allready an attendee ignore
                if (myFM.DB.Attendee.Select("ApptId=" + apptRow.ApptId.ToString() + " and ContactId=" + f.ContactId.ToString()).Length == 0)
                {
                    atriumDB.AttendeeRow attRow = (atriumDB.AttendeeRow)myFM.GetAttendee().Add(apptRow);
                    attRow.ContactId = f.ContactId;
                    AddAttendeeToTimeline(this.timeLine1.Fields["ContactId"], attRow);
                }
            }
            f.Close();
        }
Beispiel #4
0
        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);
            }
        }