Beispiel #1
0
        public void Init(atriumBE.FileManager fm, fFile parentFile)
        {
            fmCurrent = fm;
            Atmng     = fm.AtMng;

            ParentFile = parentFile;
            fileId     = fm.CurrentFile.FileId;


            if (UIHelper.getScalingFactor() > 1)
            {
                tvContents.ItemHeight = tvContents.ItemHeight + 2;
            }

            //JLL 2015-08-30 higher dpi setting handling
            //defaultTopHeight = UIHelper.AdjustHeightInt(this, defaultTopHeight);
            //defaultRowHeight = UIHelper.AdjustHeightInt(this, defaultRowHeight);
            //END JLL 2015-08-30


            // WI 75873
            if (fm.GetSSTMng() != null && !fm.CurrentFile.IsDim2IdNull())
            {
                programId = fm.CurrentFile.Dim2Id;
            }
            // -- end // WI 75873

            fm.EFile.OnUpdate += new atLogic.UpdateEventHandler(EFile_OnUpdate);
            fm.GetFileXRef().OnUpdate += new atLogic.UpdateEventHandler(ucToC_OnUpdate);

            LoadTOC();
        }
Beispiel #2
0
        private void ImportNode(appDB.IssueDataTable tempIssues, appDB.IssueRow ir, appDB.IssueRow parentIssue, int rootFileId)
        {
            //this will recreate the issue structure
            //it does not try to synchronize it
            //only to be used to setup test data
            appDB.IssueRow newIR = (appDB.IssueRow)Add(null);

            newIR.ParentIssueId    = parentIssue.IssueId;
            newIR.IssueNameEng     = ir.IssueNameEng;
            newIR.IssueNameFre     = ir.IssueNameFre;
            newIR.SortByFileNumber = ir.SortByFileNumber;

            //create file
            FileManager myFile = myA.CreateFile(myA.GetFile(rootFileId));

            myFile.CurrentFile.NameE = newIR.IssueNameEng;
            myFile.CurrentFile.NameF = newIR.IssueNameFre;

            BusinessProcess bp = myA.GetBP();

            bp.AddForUpdate(myFile.EFile);
            bp.AddForUpdate(myFile.GetFileXRef());
            bp.AddForUpdate(myFile.GetFileOffice());
            bp.AddForUpdate(myFile.GetFileContact());
            bp.AddForUpdate(myFile.EFile);
            bp.Update();

            if (!ir.IsFileIdNull())
            {
                newIR.FileId = myFile.CurrentFile.FileId;
            }
            foreach (appDB.IssueRow cir in ir.GetIssueRows())
            {
                ImportNode(tempIssues, cir, newIR, myFile.CurrentFileId);
            }
        }
Beispiel #3
0
        public void CreatePersonalFiles(int parentFileId, officeDB.OfficerRow or, bool useSeparatePersonalFiles)
        {
            //JLL: 2009/07/27 Note about CONVERSION
            // when creating personal files in Personnel Management file, structure should be:
            // Personnel Management
            //      Officers
            //      Role-Based Accounts

            //check to make sure myfileid is null
            //if (!or.IsMyFileIdNull())
            //    throw new AtriumException("File already created.");

            //check to make sure the officer has an account
            SecurityDB.secUserRow sur = myA.AtMng.SecurityManager.GetsecUser().GetSecUserForOfficer(or);

            try
            {
                //create my file
                FileManager myFile = myA.AtMng.CreateFile(myA.AtMng.GetFile(parentFileId));
                myFile.CurrentFile.NameE    = string.Format("{0}, {1} [{2}]", or.LastName, or.FirstName, or.OfficerCode);
                myFile.CurrentFile.FileType = "PR";

                BusinessProcess bp = myA.GetBP();

                bp.AddForUpdate(myFile.EFile);
                bp.AddForUpdate(myFile.GetFileXRef());
                bp.AddForUpdate(myFile.GetFileOffice());
                bp.AddForUpdate(myFile.GetFileContact());
                bp.AddForUpdate(myFile.EFile);
                bp.Update();
                //myFile.AtMng.AppMan.Commit();

                or.MyFileId = myFile.CurrentFile.FileId;

                //break security inheritance
                myFile.EFile.BreakInherit();

                //set new perms to this user and sysadmin?
                AddUserFileRule(sur.UserId, myFile.CurrentFile, (int)atSecurity.SpecialRules.MyPersonalFile);
                AddUserFileRule((int)atSecurity.SpecialGroups.Everyone, myFile.CurrentFile, (int)atSecurity.SpecialRules.ReadMail);



                //Create Setting For Below
                if (!useSeparatePersonalFiles)
                {
                    or.InboxId     = or.MyFileId;
                    or.SentItemsId = or.MyFileId;
                }
                else
                {
                    //create inbox
                    FileManager inbox = myA.AtMng.CreateFile(myFile);
                    inbox.CurrentFile.NameE = "Inbox";
                    inbox.CurrentFile.NameF = "Dossier corbeille arrivée";
                    BusinessProcess bpi = myA.GetBP();

                    bpi.AddForUpdate(inbox.EFile);
                    bpi.AddForUpdate(inbox.GetFileXRef());
                    bpi.AddForUpdate(inbox.GetFileOffice());
                    bpi.AddForUpdate(inbox.GetFileContact());
                    bpi.AddForUpdate(inbox.EFile);
                    bpi.Update();

                    or.InboxId = inbox.CurrentFile.FileId;

                    //create sentitems
                    FileManager sentItems = myA.AtMng.CreateFile(myFile);
                    sentItems.CurrentFile.NameE = "Sent Items";
                    sentItems.CurrentFile.NameF = "Dossier corbeille envoyée";
                    BusinessProcess bpsi = myA.GetBP();

                    bpsi.AddForUpdate(sentItems.EFile);
                    bpsi.AddForUpdate(sentItems.GetFileXRef());
                    bpsi.AddForUpdate(sentItems.GetFileOffice());
                    bpsi.AddForUpdate(sentItems.GetFileContact());
                    bpsi.AddForUpdate(sentItems.EFile);
                    bpsi.Update();

                    or.SentItemsId = sentItems.CurrentFile.FileId;
                }
                //create shortcuts
                FileManager shortcuts = myA.AtMng.CreateFile(myFile);
                shortcuts.CurrentFile.NameE    = "My Shortcuts";
                shortcuts.CurrentFile.NameF    = "Dossier de raccourcis";
                shortcuts.CurrentFile.MetaType = "SC";
                BusinessProcess bpsc = myA.GetBP();

                bpsc.AddForUpdate(shortcuts.EFile);
                bpsc.AddForUpdate(shortcuts.GetFileXRef());
                bpsc.AddForUpdate(shortcuts.GetFileOffice());
                bpsc.AddForUpdate(shortcuts.GetFileContact());
                bpsc.AddForUpdate(shortcuts.EFile);
                bpsc.Update();

                or.ShortcutsId = shortcuts.CurrentFile.FileId;
            }
            catch (Exception x)
            {
                //myA.AtMng.AppMan.Rollback();
                throw x;
            }
        }
Beispiel #4
0
        private void tvContents_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            try
            {
                if (e.Button == MouseButtons.Left)
                {
                    switch (tvContents.HitTest(e.Location).Location)
                    {
                    case TreeViewHitTestLocations.Label:
                    case TreeViewHitTestLocations.Image:
                    case TreeViewHitTestLocations.PlusMinus:
                        if (e.Node.Name == "filexref" | e.Node.Name == "tocxref")
                        {
                            lmDatasets.atriumDB.FileXRefRow fxr = fmCurrent.GetFileXRef().Load(System.Convert.ToInt32(e.Node.Tag));
                            if (fmCurrent.CurrentFile.FileId == fxr.FileId)
                            {
                                ParentFile.MainForm.OpenFile(fxr.OtherFileId);
                            }
                            else
                            {
                                ParentFile.MainForm.OpenFile(fxr.FileId);
                            }
                            return;
                        }

                        ParentFile.EndEdit();
                        if (this.Enabled == false)
                        {
                            return;
                        }

                        if (e.Node.Tag.ToString() != "noform")
                        {
                            try
                            {
                                if ((string)e.Node.Tag == "")
                                {
                                    ParentFile.GetUcCtlToc(GetControlForNode(e.Node.Name));
                                }
                                else
                                {
                                    int id;

                                    if (int.TryParse((string)e.Node.Tag, out id))
                                    {
                                        ParentFile.GetUcCtlToc(GetControlForNode(e.Node.Name), e.Node.Name, System.Convert.ToInt32(e.Node.Tag));
                                    }
                                    else
                                    {
                                        ParentFile.GetUcCtlToc(GetControlForNode(e.Node.Name), e.Node.Name, (string)e.Node.Tag);
                                    }
                                }
                            }
                            catch (Exception x)
                            {
                                UIHelper.HandleUIException(x);
                            }
                        }
                        ParentFile.Activate();
                        break;
                    }
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }