Beispiel #1
0
        private void editBox1_ButtonClick(object sender, EventArgs e)
        {
            if (fileBrowser == null)
            {
                fileBrowser = new fBrowse(AtMng, 0, false, false, false, true);
            }

            //tag stores value for AccessAllowed to target file
            //JLL 2010-08-23 added:
            //&& FileId.GetType()!=typeof(System.DBNull)
            //as FileId was set to DBNull in admin Issues screen

            if (FileId != null && FileId.GetType() != typeof(System.DBNull) && (bool)editBox1.Tag)
            {
                fileBrowser.FindFile((int)FileId);
            }

            if (fileBrowser.ShowDialog() == DialogResult.OK)
            {
                if (fileBrowser.SelectedFile != null)
                {
                    isChanged = true;
                    FileId    = fileBrowser.FileId;
                }
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        private void DoMove()
        {
            fWait fProgress = new fWait();

            try
            {
                if (fileBrowser == null)
                {
                    fileBrowser = new fBrowse(myFM.AtMng, 0, false, false, false, true);
                }

                fileBrowser.FindFile(myFM.CurrentFileId);
                if (fileBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    //make dict of rows
                    Dictionary <int, appDB.EFileSearchRow> FilesToMove = new Dictionary <int, appDB.EFileSearchRow>();
                    foreach (Janus.Windows.GridEX.GridEXSelectedItem gsi in eFileSearchGridEX.SelectedItems)
                    {
                        appDB.EFileSearchRow efsr1 = (appDB.EFileSearchRow)((DataRowView)gsi.GetRow().DataRow).Row;
                        FilesToMove.Add(efsr1.FileId, efsr1);
                    }
                    try
                    {
                        foreach (appDB.EFileSearchRow efsr in FilesToMove.Values)
                        {
                            fProgress.setMessageText("Moving: " + efsr.Name);
                            fProgress.Show();
                            fProgress.Refresh();

                            FileManager filetomove1 = myFM.AtMng.GetFile(efsr.FileId);
                            //filetomove1.EFile.Move(filetomove1.CurrentFile, f.SelectedFile.FileId, true);
                            UIHelper.MoveFile(filetomove1, fileBrowser.SelectedFile.FileId);

                            atLogic.BusinessProcess bp = myFM.AtMng.GetBP();
                            bp.AddForUpdate(filetomove1.GetFileXRef());
                            bp.AddForUpdate(filetomove1.EFile);
                            bp.Update();
                        }
                    }
                    catch (Exception x)
                    {
                        myFM.DB.FileXRef.RejectChanges();
                        myFM.DB.EFile.RejectChanges();

                        Cursor.Current = Cursors.Default;
                        fProgress.Close();
                        UIHelper.HandleUIException(x);
                    }
                    Cursor.Current = Cursors.Default;
                    fProgress.Close();
                }
                LoadChildren(myFM);
            }
            catch (Exception x1)
            {
                fProgress.Close();
                throw x1;
            }
        }