Exemple #1
0
        private void WriteErrorLog(string errorMsg)
        {
            if (errorLog == null)
            {
                //create error log doc
                errorLog = (docDB.DocumentRow)myA.GetDocMng().GetDocument().Add(myA.CurrentFile);
                myA.GetDocMng().GetDocContent().Add(errorLog);
                errorLog.IsDraft                      = true;
                errorLog.DocContentRow.Ext            = ".txt";
                errorLog.efSubject                    = DocumentBE.VerifySubjectLength(Resources.DisbursementImportErrorLog);
                errorLog.DocContentRow.ContentsAsText = Resources.DisbErrorHeader + Environment.NewLine;
            }
            //StreamWriter sr;

            //if (!File.Exists(filePath))
            //    sr = File.CreateText(filePath);
            //else
            //    sr = new StreamWriter(filePath, true);

            //sr.WriteLine (errorMsg);
            //sr.Close();

            errorLog.DocContentRow.ContentsAsText += errorMsg + Environment.NewLine;

            BusinessProcess bp = myA.GetDocMng().GetBP();

            bp.AddForUpdate(myA.GetDocMng().GetDocContent());
            bp.AddForUpdate(myA.GetDocMng().GetDocument());
            bp.Update();
        }
Exemple #2
0
        public void SaveAll()
        {
            BusinessProcess bp = GetBP();

            if (!IsVirtualFM && this.CurrentFile != null && this.CurrentFile.RowState == DataRowState.Added)
            {
                bp.AddForUpdate(this.EFile);


                bp.AddForUpdate(this.GetFileXRef());

                this.GetActivity().Update(bp);
            }
            else
            {
                this.GetActivity().Update(bp);

                //efile must be update again at the end to save the filestructxml changes
                bp.AddForUpdate(this.EFile);
            }

            foreach (BEManager be in this.MyMngrs.Values)
            {
                be.Update(bp);
            }


            bp.Update();

            if (!IsVirtualFM && this.CurrentFile != null)
            {
                this.CurrentFile.FileStructXml = EFile.CalcFileStructXml(this.CurrentFile, true, false).OuterXml;
                this.CurrentFile.AcceptChanges();
            }
        }
Exemple #3
0
        internal void CreateGroup(officeDB.OfficeRow or, FileManager offFM)
        {
            SecurityDB.secGroupRow gr = (SecurityDB.secGroupRow)offFM.AtMng.SecurityManager.GetsecGroup().Add(null);
            gr.GroupName = or.OfficeName;
            gr.DescE     = or.OfficeName;
            gr.DescF     = or.OfficeNameFre;

            BusinessProcess bp = myA.GetBP();

            bp.AddForUpdate(offFM.AtMng.SecurityManager.GetsecGroup());
            bp.Update();


            offFM.EFile.BreakInherit();
            atriumDB.secFileRuleRow sfr = (atriumDB.secFileRuleRow)offFM.GetsecFileRule().Add(offFM.CurrentFile);
            sfr.FileId  = offFM.CurrentFile.FileId;
            sfr.GroupId = gr.GroupId;
            sfr.RuleId  = (int)atSecurity.SpecialRules.GeneralRule;

            BusinessProcess bp1 = myA.GetBP();

            bp1.AddForUpdate(offFM.GetsecFileRule());
            bp1.Update();

            //get rid of new row if present as database new row will have been returned with a different pkid
            lmDatasets.atriumDB.secFileRuleRow sfr0 = offFM.DB.secFileRule.FindById(0);
            if (sfr0 != null)
            {
                offFM.DB.secFileRule.RemovesecFileRuleRow(sfr0);
                offFM.DB.secFileRule.AcceptChanges();
            }
        }
Exemple #4
0
        public atriumDB.FileContactRow AddRecipToFile(docDB.RecipientRow r, bool save, string contactType)
        {
            FileManager fm = myA.FM;

            atriumDB.FileContactRow fcr = fm.GetFileContact().Add(r, contactType);;


            if (save)
            {
                BusinessProcess bp = fm.GetBP();
                bp.AddForUpdate(fm.GetFileOffice());
                bp.AddForUpdate(fm.GetPerson());
                bp.AddForUpdate(fm.GetFileContact());
                bp.AddForUpdate(fm.EFile);
                bp.Update();
            }

            return(fcr);
        }
Exemple #5
0
        private void DisbUpdate(bool encounteredError)
        {
            if (encounteredError)
            {
                fms.Clear();
                throw new AtriumException(Resources.SRPDisbErr);
            }
            else
            {
                try
                {
                    foreach (FileManager fmCur in fms.Values)
                    {
                        if (!fmCur.DB.HasErrors)
                        {
                            atriumBE.DisbursementBE disbBE     = fmCur.GetDisbursement();
                            atriumBE.ActivityBE     activityBE = fmCur.GetActivity();
                            BusinessProcess         bp         = fmCur.GetBP();
                            bp.AddForUpdate(activityBE);
                            bp.AddForUpdate(disbBE);
                            bp.Update();
                        }
                        else
                        {
                            throw new AtriumException(Resources.SRPDisbErr);
                        }
                    }

                    fms.Clear();
                }
                catch (Exception x)
                {
                    fms.Clear();

                    throw x;
                }
            }
        }
Exemple #6
0
 public void Save()
 {
     try
     {
         BusinessProcess bp = myA.GetBP();
         bp.AddForUpdate(this);
         bp.Update();
     }
     catch (Exception ex)
     {
         this.myBatchDT.RejectChanges();
         throw ex;
     }
 }
Exemple #7
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);
            }
        }
Exemple #8
0
 public void SavePrefsCommit()
 {
     //save and commit
     try
     {
         BusinessProcess bp = myA.GetBP();
         bp.AddForUpdate(this);
         bp.Update();
     }
     catch (Exception x)
     {
         // myA.AtMng.AppMan.Rollback();
         //Add an entry to auditlog if setpref fails?
         //throw an error?  no, right?
     }
 }
Exemple #9
0
 public void Save()
 {
     try
     {
         BusinessProcess bp = myBEMng.GetBP();
         bp.AddForUpdate(this);
         bp.Update();
         //this.Update();
         //myBEMng.Commit();
         //this.mysecUserDT.AcceptChanges();
     }
     catch (Exception ex)
     {
         this.mysecUserDT.RejectChanges();
         throw ex;
     }
 }
Exemple #10
0
        public void SubmitJob(string job, string parameters)
        {
            try
            {
                lmDatasets.appDB.BatchRow br = (lmDatasets.appDB.BatchRow)Add(null);
                br.JobName    = job;
                br.Parameters = parameters;

                BusinessProcess bp = myA.GetBP();
                bp.AddForUpdate(this);
                bp.Update();
            }
            catch (Exception x)
            {
                myBatchDT.RejectChanges();
                throw x;
            }
        }
Exemple #11
0
        public void Import(string path, int rootIssueId, int targetIssueId, int rootFileId)
        {
            appDB ds = new appDB();

            ds.ReadXml(path);

            appDB.IssueDataTable tempIssues = ds.Issue;

            appDB.IssueRow ir  = tempIssues.FindByIssueId(rootIssueId);
            appDB.IssueRow pir = myIssueDT.FindByIssueId(targetIssueId);


            ImportNode(tempIssues, ir, pir, rootFileId);

            BusinessProcess bp = myA.GetBP();

            bp.AddForUpdate(this);
            bp.Update();
        }
Exemple #12
0
        internal void AddUserFileRule(int groupId, atriumDB.EFileRow file, int ruleId)
        {
            FileManager fm = myA.AtMng.GetFile(file.FileId);

            atriumDB.secFileRuleRow sfr = (atriumDB.secFileRuleRow)fm.GetsecFileRule().Add(file);
            sfr.FileId  = file.FileId;
            sfr.GroupId = groupId;
            sfr.RuleId  = ruleId;

            BusinessProcess bp = fm.GetBP();

            bp.AddForUpdate(fm.GetsecFileRule());
            bp.Update();
            //myA.AtMng.SecurityManager.Commit();

            //get rid of new row if present as database new row will have been returned with a different pkid
            //lmDatasets.SecurityDB.secFileRuleRow sfr0 = myA.AtMng.SecurityManager.DB.secFileRule.FindById(0);
            //if (sfr0 != null)
            //{
            //    myA.AtMng.SecurityManager.DB.secFileRule.RemovesecFileRuleRow(sfr0);
            //    myA.AtMng.SecurityManager.DB.secFileRule.AcceptChanges();
            //}
        }
Exemple #13
0
 public override void Update(BusinessProcess BP)
 {
     BP.AddForUpdate(DB.DocTransfer);
     BP.AddForUpdate(DB.DocDump, "Document");
     BP.AddForUpdate(DB.SSTCase);
     BP.AddForUpdate(DB.SSTGroup);
     BP.AddForUpdate(DB.SSTDecision);
     BP.AddForUpdate(DB.SSTRequest);
     BP.AddForUpdate(DB.SSTReqRecipient);
     BP.AddForUpdate(DB.SSTCaseMatter);
     BP.AddForUpdate(DB.SSTAppealGround); // WI 75221
     BP.AddForUpdate(DB.FileParty);
     BP.AddForUpdate(DB.Hearing);
     BP.AddForUpdate(DB.ADMSEAppeal);
     BP.AddForUpdate(DB.ADMSEDecision);
     BP.AddForUpdate(DB.ADMSEIssues);
     BP.AddForUpdate(DB.ADMSEParticipant);
     BP.AddForUpdate(DB.ADMSPAppeal);
     BP.AddForUpdate(DB.ADMSPDecision);
     BP.AddForUpdate(DB.ADMSPIssues);
     BP.AddForUpdate(DB.ADMSPParticipant);
     BP.AddForUpdate(DB.FormHearing);
 }
Exemple #14
0
 public override void Update(BusinessProcess BP)
 {
     BP.AddForUpdate(GetDebtor(), "Address");
     BP.AddForUpdate(GetFileHistory());
     BP.AddForUpdate(GetJudgment());
     BP.AddForUpdate(GetJudgmentAccount());
     BP.AddForUpdate(GetDebt());
     BP.AddForUpdate(GetAccountHistory());
     BP.AddForUpdate(GetTaxing());
     BP.AddForUpdate(GetWrit());
     BP.AddForUpdate(GetWritHistory());
     BP.AddForUpdate(GetCashBlotter());
     BP.AddForUpdate(GetCBDetail());
     BP.AddForUpdate(GetProperty());
     BP.AddForUpdate(GetBankruptcy());
     BP.AddForUpdate(GetBankruptcyAccount());
     BP.AddForUpdate(GetInsolvency());
     BP.AddForUpdate(GetInsolvencyAccount());
     BP.AddForUpdate(GetCompOffer());
     BP.AddForUpdate(GetCompOfferDetail());
     BP.AddForUpdate(GetHardship());
     BP.AddForUpdate(GetCost());
     BP.AddForUpdate(GetOfficeAccount());
 }
Exemple #15
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;
            }
        }
Exemple #16
0
        public override void Update(BusinessProcess BP)
        {
            BP.AddForUpdate(GetPerson());
            BP.AddForUpdate(DB.AKA);
            BP.AddForUpdate(DB.Address);
            BP.AddForUpdate(DB.ApptRecurrence);
            BP.AddForUpdate(DB.Appointment);
            BP.AddForUpdate(DB.Attendee);
            BP.AddForUpdate(DB.SRP);
            BP.AddForUpdate(DB.IRP);
            BP.AddForUpdate(DB.RiskAssessment);
            BP.AddForUpdate(DB.RAClientImpact);
            BP.AddForUpdate(DB.FileOffice);
            BP.AddForUpdate(DB.FileContact);
            BP.AddForUpdate(GetFileXRef());
            BP.AddForUpdate(DB.secFileRule);
            BP.AddForUpdate(DB.FileFlag);
            BP.AddForUpdate(DB.ArchiveBatch);

            if (myddEntity != null)
            {
                foreach (ddEntityBE d in myddEntity.Values)
                {
                    BP.AddForUpdate(d);
                }
            }
        }
Exemple #17
0
 public override void Update(BusinessProcess BP)
 {
     BP.AddForUpdate(DB.Office, "FileOffice");
     BP.AddForUpdate(DB.ServiceCentre);
     BP.AddForUpdate(DB.Officer);
 }