Exemplo n.º 1
0
        public void DynBeforeUpdate(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition, Dictionary <string, appDB.ddFieldRow> ruleColumnMap)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            FileManager fm = GetFMFromBE(be);

            foreach (appDB.ddRuleRow ddr in ruleDefinition.GetddRuleRows())
            {
                //for "beforeupdate" event
                if (ddr.EventId == 2 && ddr.Enabled)
                {
                    //check rules
                    RunRule(null, dr, null, fm, null, ddr);
                }
                if (ddr.EventId == 10 && ddr.Enabled)
                {
                    //check rules
                    //needs to run for column
                    //need columnmap
                    DataColumn       dc  = dr.Table.Columns[ddr.ddFieldRow.DBFieldName];
                    appDB.ddFieldRow dfr = ruleColumnMap[dc.ColumnName];
                    RunRule(dc, dr, ruleColumnMap, fm, dfr, ddr);
                }
                if (ddr.EventId == 5 && ddr.Enabled && dr.RowState == DataRowState.Added)
                {
                    //check rules
                    RunRule(null, dr, null, fm, null, ddr);
                }
            }
        }
Exemplo n.º 2
0
 public void ExecuteRule(BEManager fm, appDB.ddRuleRow thisRule, DataRow rowToCheck, DataColumn columnToCheck, string msg)
 {
     if (rowToCheck.IsNull(columnToCheck))
     {
         throw new AtriumException(msg);
     }
 }
Exemplo n.º 3
0
        public void LoadByContactId(int ContactId)
        {
            DataSet ds = new atriumDB();

            PreRefresh();
            myA.GetAttendee().PreRefresh();

            if (myA.AtMng.AppMan.UseService)
            {
                ds = BEManager.DecompressDataSet(myA.AtMng.AppMan.AtriumX().AppointmentLoadByContactId(ContactId, myA.AtMng.AppMan.AtriumXCon), ds);
            }
            else
            {
                try
                {
                    ds = BEManager.DecompressDataSet(myDAL.LoadAllForOfficer(ContactId), ds);
                }
                catch (System.Runtime.Serialization.SerializationException x)
                {
                    RecoverDAL();
                    ds = BEManager.DecompressDataSet(myDAL.LoadAllForOfficer(ContactId), ds);
                }
            }
            Fill(ds.Tables["Appointment"]);
            myA.GetApptRecurrence().Fill(ds.Tables["ApptRecurrence"]);
            myA.GetAttendee().Fill(ds.Tables["Attendee"]);
            SetLocalDates();
            ds.Clear();
            ds.Dispose();
        }
Exemplo n.º 4
0
        public void DynBeforeAdd(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            //rarely or never used
        }
Exemplo n.º 5
0
        public void DynAfterDelete(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            //never used as the record is effectively gone
        }
Exemplo n.º 6
0
        public int LoadBF(int officeId, int officerID, DateTime date, bool refresh)
        {
            if (refresh)
            {
                //                myLastEdit = new DateTime(1900, 1, 1);
                myLastTS = 0;
                //myDAL.PreRefresh();
            }
            else
            {
                //  myA.AtMng.LogMessage(String.Format("RefreshBF {0} {1}", myA.IsVirtualFM, myA.CurrentFileId));
            }


            if (myActivityBFDT.Rows.Count > 0)
            {
                myLastTS = (Int64)myActivityBFDT.Select("", "ver desc")[0]["ver"];
            }


            int     i;
            DataSet ds;

            if (myA.AtMng.AppMan.UseService)
            {
                ds = BEManager.DecompressDataSet(myA.AtMng.AppMan.AtriumX().ActivityBFLoadBF(officeId, officerID, date, myA.AtMng.OfficeLoggedOn.OfficerBF, myLastTS, myA.AtMng.AppMan.AtriumXCon), new atriumDB());
            }
            else
            {
                //to fix two threads using connection at same time
                atriumDAL.ActivityBFDAL abdal = myDAL;
                if (!refresh)
                {
                    atriumDAL.atriumDALManager adm = new atriumDAL.atriumDALManager(myA.AtMng.AppMan.myUser, myA.AtMng.AppMan.myPwd, myA.AtMng.AppMan.Connect);
                    abdal = adm.GetActivityBF();
                }
                try
                {
                    ds = atLogic.BEManager.DecompressDataSet(abdal.LoadBF(officeId, officerID, date, myA.AtMng.OfficeLoggedOn.OfficerBF, myLastTS), new atriumDB());
                }
                catch (System.Runtime.Serialization.SerializationException x)
                {
                    RecoverDAL();
                    ds = atLogic.BEManager.DecompressDataSet(myDAL.LoadBF(officeId, officerID, date, myA.AtMng.OfficeLoggedOn.OfficerBF, myLastTS), new atriumDB());
                }
            }
            i = ds.Tables["ACtivityBF"].Rows.Count;
            Fill(ds.Tables["ActivityBF"]);

            return(i);
        }
Exemplo n.º 7
0
        private FileManager GetFMFromBE(BEManager be)
        {
            FileManager fm;

            if (be.GetType() == typeof(FileManager))
            {
                fm = (FileManager)be;
            }
            else
            {
                fm = myA.GetFile(be.CurrentFileId);
            }
            return(fm);
        }
Exemplo n.º 8
0
        public override void LoadAll(bool refresh)
        {
            if (refresh)
            {
                GetSSTCase().PreRefresh();
                GetSSTGroup().PreRefresh();
                GetSSTDecision().PreRefresh();
                GetSSTRequest().PreRefresh();
                GetSSTReqRecipient().PreRefresh();
                GetSSTCaseMatter().PreRefresh();
                GetSSTAppealGround().PreRefresh(); // WI 75221
                GetFileParty().PreRefresh();
                GetHearing().PreRefresh();
                GetFormHearing().PreRefresh();
            }


            DataSet ds;

            try
            {
                ds = BEManager.DecompressDataSet(GetSSTCase().myDAL.LoadAll(myFM.CurrentFileId), new SST());
            }
            catch (System.Runtime.Serialization.SerializationException x)
            {
                GetSSTCase().RecoverDAL();
                ds = BEManager.DecompressDataSet(GetSSTCase().myDAL.LoadAll(myFM.CurrentFileId), new SST());
            }

            GetSSTCase().Fill(ds.Tables["SSTCase"]);
            GetSSTCase().CalcDates();

            GetSSTGroup().Fill(ds.Tables["SSTGroup"]);
            GetSSTDecision().Fill(ds.Tables["SSTDecision"]);
            GetSSTRequest().Fill(ds.Tables["SSTRequest"]);
            GetSSTReqRecipient().Fill(ds.Tables["SSTReqRecipient"]);
            GetSSTCaseMatter().Fill(ds.Tables["SSTCaseMatter"]);
            GetSSTAppealGround().Fill(ds.Tables["SSTAppealGround"]); // WI 75221
            GetFileParty().Fill(ds.Tables["FileParty"]);
            GetFileParty().CalcRecipType();
            GetHearing().Fill(ds.Tables["Hearing"]);
            GetFormHearing().Fill(ds.Tables["FormHearing"]);

            ds.Clear();
            ds.Dispose();
        }
Exemplo n.º 9
0
 public atLogic.ObjectBE GetBEFromTable(DataTable dt)
 {
     atLogic.ObjectBE oBE = (atLogic.ObjectBE)dt.ExtendedProperties["BE"];
     if (oBE == null)
     {
         if (dt.TableName == "Contact")
         {
             oBE = GetPerson();
         }
         else
         {
             BEManager mngr = MyMngrs[dt.DataSet.DataSetName];
             Type      ty   = mngr.GetType();
             System.Reflection.MethodInfo mi = ty.GetMethod("Get" + dt.TableName);
             oBE = (atLogic.ObjectBE)mi.Invoke(mngr, null);
         }
     }
     return(oBE);
 }
Exemplo n.º 10
0
        public void DynBeforeChange(BEManager be, DataColumn dc, DataRow dr, Dictionary <string, appDB.ddFieldRow> ruleColumnMap)
        {
            //find row in ddfield
            if (ruleColumnMap.ContainsKey(dc.ColumnName))
            {
                FileManager fm = GetFMFromBE(be);

                appDB.ddFieldRow dfr = ruleColumnMap[dc.ColumnName];
                //find rules for field
                foreach (appDB.ddRuleRow ddr in dfr.GetddRuleRows())
                {
                    //for "beforechange" event
                    if ((ddr.EventId == 1 | ddr.EventId == 10) && ddr.Enabled)
                    {
                        //check rules
                        RunRule(dc, dr, ruleColumnMap, fm, dfr, ddr);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public void ExecuteRule(BEManager _fm, appDB.ddRuleRow thisRule, DataRow rowToCheck, DataColumn columnToCheck, string msg)
        {
            FileManager fm   = (FileManager)_fm;
            string      pkid = rowToCheck.Table.PrimaryKey[0].ColumnName;

            int increm = 10;

            if (!thisRule.IsVal2Null())
            {
                increm = System.Convert.ToInt32(thisRule.Val2);
            }
            string objectNm = rowToCheck.Table.TableName;

            if (!thisRule.IsVal1Null())
            {
                objectNm = thisRule.Val1;
            }

            rowToCheck[pkid] = fm.AtMng.PKIDGet(objectNm, increm);
        }
Exemplo n.º 12
0
        public void ExecuteRule(BEManager _fm, appDB.ddRuleRow thisRule, DataRow rowToCheck, DataColumn columnToCheck, string msg)
        {
            FileManager fm = (FileManager)_fm;

            atriumDB.FileContactRow dr = (atriumDB.FileContactRow)rowToCheck;
            //if contact type is once per file see if it it on any other records
            bool once = false;

            once = (bool)fm.Codes("ContactType").Select("ContactTypeCode='" + dr.ContactType + "'")[0]["OncePerFile"];
            if (once)
            {
                foreach (atriumDB.FileContactRow fcr1 in dr.Table.Rows)
                {
                    if (!fcr1.IsNull("ContactType") && fcr1.ContactType == dr.ContactType && dr.FileContactid != fcr1.FileContactid)
                    {
                        throw new AtriumException(msg, dr.ContactType);
                    }
                }
            }
        }
Exemplo n.º 13
0
        public void DynBeforeDelete(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            FileManager fm = GetFMFromBE(be);

            //find rules for field
            foreach (appDB.ddRuleRow ddr in ruleDefinition.GetddRuleRows())
            {
                //for "beforedelete" event
                if (ddr.EventId == 3 && ddr.Enabled)
                {
                    //check rules
                    RunRule(null, dr, null, fm, null, ddr);
                }
            }
        }
Exemplo n.º 14
0
        public void DynAfterUpdate(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            //rarely used except for toc  xml which is obsolete
            FileManager fm = GetFMFromBE(be);

            //find rules for field
            foreach (appDB.ddRuleRow ddr in ruleDefinition.GetddRuleRows())
            {
                //for "afterupdate" event
                if (ddr.EventId == 8 && ddr.Enabled)
                {
                    //check rules
                    RunRule(null, dr, null, fm, null, ddr);
                }
            }
        }
Exemplo n.º 15
0
        public void DynAfterAdd(BEManager be, DataRow dr, appDB.ddTableRow ruleDefinition)
        {
            if (ruleDefinition == null)
            {
                return;
            }

            FileManager fm = GetFMFromBE(be);

            //set defaults
            myA.GetddField().DynDefaultValues(fm, dr, ruleDefinition);

            foreach (appDB.ddRuleRow ddr in ruleDefinition.GetddRuleRows())
            {
                //for "beforeupdate" event
                if (ddr.EventId == 4 && ddr.Enabled)
                {
                    //check rules
                    RunRule(null, dr, null, fm, null, ddr);
                }
            }
        }
Exemplo n.º 16
0
        //TFS#54344 CJW 2013-8-21
        //new mthod clears data before loading when refreshing
        public override void LoadAll(bool refresh)
        {
            int delay = -AtMng.GetSetting(AppIntSetting.FileReloadInterval);

            if (refresh)
            {
                lastFileRefresh = DateTime.Now.AddSeconds(delay - 60);
                GetFileContact().PreRefresh();
                GetPerson().PreRefresh();
                GetFileOffice().PreRefresh();
                GetFileXRef().PreRefresh();
                GetFileAKA().PreRefresh();
                GetAppointment().PreRefresh();
                GetAppointment().SetLocalDates();
                GetApptRecurrence().PreRefresh();
                GetAttendee().PreRefresh();
                GetAddress().PreRefresh();
                GetsecFileRule().PreRefresh();
                GetFileFlag().PreRefresh();

                GetIRP().PreRefresh();
                GetRiskAssessment().PreRefresh();
                GetAKA().PreRefresh();
                GetArchiveBatch().PreRefresh();

                foreach (ddEntityBE d in myddEntity.Values)
                {
                    d.PreRefresh();
                }
            }

            if (DateTime.Now.AddSeconds(delay).CompareTo(lastFileRefresh) > 0)
            {
                DataSet ds = null;
                if (AtMng.AppMan.ServerInfo.useService)
                {
                    atLogic.AtriumX.AtriumXClient axc = AtMng.AppMan.AtriumX();

                    ds = BEManager.DecompressDataSet(axc.LoadFile(CurrentFileId, AtMng.AppMan.AtriumXCon), new atriumDB());
                }
                else
                {
                    try
                    {
                        ds = BEManager.DecompressDataSet(this.EFile.myDAL.MainLoadByFileId(CurrentFileId), new atriumDB());
                    }
                    catch (System.Runtime.Serialization.SerializationException x)
                    {
                        this.EFile.RecoverDAL();
                        ds = BEManager.DecompressDataSet(this.EFile.myDAL.MainLoadByFileId(CurrentFileId), new atriumDB());
                    }
                }
                EFile.Fill(ds.Tables["EFile"]);

                this.GetFileContact().Fill(ds.Tables["FileContact"]);
                this.GetPerson().Fill(ds.Tables["Contact"]);
                this.GetFileOffice().Fill(ds.Tables["FileOffice"]);
                this.GetFileXRef().Fill(ds.Tables["FileXRef"]);
                this.GetFileAKA().Fill(ds.Tables["FileAKA"]);
                this.GetAppointment().Fill(ds.Tables["Appointment"]);
                this.GetAppointment().SetLocalDates();
                this.GetApptRecurrence().Fill(ds.Tables["ApptRecurrence"]);
                this.GetAttendee().Fill(ds.Tables["Attendee"]);
                this.GetAddress().Fill(ds.Tables["Address"]);
                this.GetsecFileRule().Fill(ds.Tables["secFileRule"]);
                this.GetFileFlag().Fill(ds.Tables["FileFlag"]);
                this.GetArchiveBatch().Fill(ds.Tables["ArchiveBatch"]);

                this.GetIRP().Fill(ds.Tables["IRP"]);
                this.GetRiskAssessment().Fill(ds.Tables["RiskAssessment"]);
                this.GetAKA().Fill(ds.Tables["AKA"]);

                LoadDDEntities(ds.Tables["ddEntity"]);
                // this.GetddEntity("MOP").Fill(ds.Tables["ddEntity"]);

                ds.Clear();
                ds.Dispose();
                lastFileRefresh = DateTime.Now;


                this.CurrentFile.FileStructXml = EFile.CalcFileStructXml(this.CurrentFile, true, false).OuterXml;
                this.CurrentFile.AcceptChanges();
            }
        }
Exemplo n.º 17
0
        public override void LoadAll(bool refresh)
        {
            if (refresh)
            {
                GetFileHistory().PreRefresh();
                GetDebt().PreRefresh();
                GetAccountHistory().PreRefresh();
                GetJudgment().PreRefresh();
                GetJudgmentAccount().PreRefresh();
                GetCost().PreRefresh();
                GetWrit().PreRefresh();
                GetWritHistory().PreRefresh();
                GetProperty().PreRefresh();
                GetCashBlotter().PreRefresh();
                GetCBDetail().PreRefresh();
                GetBankruptcy().PreRefresh();
                GetBankruptcyAccount().PreRefresh();
                GetInsolvency().PreRefresh();
                GetInsolvencyAccount().PreRefresh();
                GetHardship().PreRefresh();
                GetCompOffer().PreRefresh();
                GetCompOfferDetail().PreRefresh();
                GetTaxing().PreRefresh();
                GetOfficeAccount().PreRefresh();

                GetDebtor().PreRefresh();
            }


            DataSet ds;

            if (myatMng.AppMan.UseService)
            {
                ds = BEManager.DecompressDataSet(myatMng.AppMan.AtriumX().LoadCLAS(FM.CurrentFileId, myatMng.AppMan.AtriumXCon), new lmDatasets.CLAS());
            }
            else
            {
                try
                {
                    ds = BEManager.DecompressDataSet(this.FM.EFile.myDAL.CLASLoadByFileId(FM.CurrentFileId), new lmDatasets.CLAS());
                }
                catch (System.Runtime.Serialization.SerializationException x)
                {
                    this.FM.EFile.RecoverDAL();
                    ds = BEManager.DecompressDataSet(this.FM.EFile.myDAL.CLASLoadByFileId(FM.CurrentFileId), new lmDatasets.CLAS());
                }
            }
            GetFileHistory().Fill(ds.Tables["FileHistory"]);
            GetDebt().Fill(ds.Tables["Debt"]);
            GetAccountHistory().Fill(ds.Tables["AccountHistory"]);
            GetJudgment().Fill(ds.Tables["Judgment"]);
            GetJudgmentAccount().Fill(ds.Tables["JudgmentAccount"]);
            GetCost().Fill(ds.Tables["Cost"]);
            GetWrit().Fill(ds.Tables["Writ"]);
            GetWritHistory().Fill(ds.Tables["WritHistory"]);
            GetProperty().Fill(ds.Tables["Property"]);
            GetCashBlotter().Fill(ds.Tables["CashBlotter"]);
            GetCBDetail().Fill(ds.Tables["CBDetail"]);
            GetBankruptcy().Fill(ds.Tables["Bankruptcy"]);
            GetBankruptcyAccount().Fill(ds.Tables["BankruptcyAccount"]);
            GetInsolvency().Fill(ds.Tables["Insolvency"]);
            GetInsolvencyAccount().Fill(ds.Tables["InsolvencyAccount"]);
            GetHardship().Fill(ds.Tables["Hardship"]);
            GetCompOffer().Fill(ds.Tables["CompOffer"]);
            GetCompOfferDetail().Fill(ds.Tables["CompOfferDetail"]);
            GetTaxing().Fill(ds.Tables["Taxing"]);
            GetOfficeAccount().Fill(ds.Tables["OfficeAccount"]);

            GetDebtor().Fill(ds.Tables["Debtor"]);

            ds.Clear();
            ds.Dispose();
        }