Ejemplo n.º 1
0
 public override System.Collections.Generic.List <int> Accounts(int id)
 {
     CLAS.JudgmentAccountRow ahr             = myJudgmentAccountDT.FindByJudgmentAccountID(id);
     System.Collections.Generic.List <int> l = new System.Collections.Generic.List <int>();
     l.Add(ahr.FileAccountID);
     return(l);
 }
Ejemplo n.º 2
0
        protected override void AfterAdd(DataRow row)
        {
            CLAS.JudgmentRow dr         = (CLAS.JudgmentRow)row;
            string           ObjectName = this.myJudgmentDT.TableName;

            dr.JudgmentID = this.myA.AtMng.PKIDGet(ObjectName, 1);
            dr.FileID     = myA.FM.CurrentFile.FileId;
            dr.CombineAccountsAfterJudgment = false;
            dr.OfficeID = this.myA.FM.CurrentFile.LeadOfficeId;
            //copy over active accounts

            JudgmentAccountBE jaBE = this.myA.GetJudgmentAccount();


            foreach (CLAS.DebtRow debtr in this.myA.DB.Debt)
            {
                //&& debtr.IsClosureCodeNull()
                if (debtr.ActiveWithJustice)                //  && debtr.OfficeID==debtr.EFileRow.LeadOfficeId) JLL 2010-08-11 Review this check
                {
                    CLAS.JudgmentAccountRow jar = (CLAS.JudgmentAccountRow)jaBE.Add(dr);
                    jar.BeginEdit();
                    jar.FileAccountID      = debtr.FileAccountId;
                    jar.AccountTypeCode    = debtr.AccountTypeCode;
                    jar.AccountTypeId      = debtr.AccountTypeId;
                    jar.AccountTypeDescEng = debtr.AccountTypeDescEng;
                    jar.AccountTypeDescFre = debtr.AccountTypeDescEng;
                    jar.DARSAccountType    = debtr.DARSAccountType;
                    jar.AccountPrincipal   = debtr.PrincipalAmount;
                    jar.Include            = true;
                    jar.EndEdit();
                }
            }
        }
Ejemplo n.º 3
0
 public void ApplyJudgementAccountSecurity(DataRow dr)
 {
     if (dr != null)
     {
         CLAS.JudgmentAccountRow jr = (CLAS.JudgmentAccountRow)dr;
         UIHelper.EnableControls(atriumDB_JudgmentAccountDataTableBindingSource, FM.GetCLASMng().GetJudgmentAccount().CanEdit(jr));
     }
 }
Ejemplo n.º 4
0
        protected override void BeforeUpdate(DataRow ddr)
        {
            CLAS.JudgmentAccountRow dr = (CLAS.JudgmentAccountRow)ddr;

            if (dr.RowState == DataRowState.Added && !dr.Include)
            {
                dr.Delete();
                //2016-05-03 JLL: without the return below, object reference errors are thrown below when judgment accounts are de-selected from AC 404
                return;
            }

            if (dr.JudgmentRow.IsJudgmentDateNull() || dr.JudgmentRow.IsNull(dr.JudgmentRow.Table.Columns["JudgmentDate"], DataRowVersion.Original))
            {
                CLAS.DebtRow debtR = dr.DebtRow;

                if (!dr.JudgmentRow.IsJudgmentDateNull())
                {
                    debtR.LPCode          = "8";
                    debtR.LPDate          = dr.JudgmentRow.JudgmentDate;
                    debtR.LPExpires       = dr.JudgmentRow.JudgmentLPDate;
                    debtR.CurrentTo       = dr.JudgmentRow.JudgmentDate;
                    debtR.PrincipalAmount = dr.JudgmentAmount;
                    debtR.InterestAmount  = 0;
                    debtR.InterestRate    = dr.IsPostJudgmentInterestRateNull() ? 0: dr.PostJudgmentInterestRate;
                    if (dr.IsPostJudgmentRateTypeNull())
                    {
                        debtR.RateType = dr.PostJudgmentRateType;
                    }
                    debtR.InterestFromDate = dr.AccruedFromDate;
                }

                //the following code is obsolete as of nov 26 2008 per chris and jean
                //else
                //{
                //    if(!dr.IsPrincipalAmountBeforeJudgmentNull())
                //        debtR.PrincipalAmount=dr.PrincipalAmountBeforeJudgment;

                //    if(!dr.IsPreJudgmentInterestToNull())
                //        debtR.CurrentTo=dr.PreJudgmentInterestTo;

                //    if(!dr.IsPreJudgmentInterestAmountNull())
                //        debtR.InterestAmount=dr.PreJudgmentInterestAmount;

                //    if(!dr.IsPreJudgmentInterestRateNull())
                //        debtR.InterestRate=dr.PreJudgmentInterestRate;

                //    if(!dr.IsPreJudgmentInterestFromNull())
                //        debtR.InterestFromDate=dr.PreJudgmentInterestFrom;

                //    if(!dr.IsPreJudgmentRateTypeNull())
                //        debtR.RateType=dr.PreJudgmentRateType;
                //}
                //debtR.EndEdit();
            }
        }
Ejemplo n.º 5
0
        protected override void AfterAdd(DataRow row)
        {
            CLAS.JudgmentAccountRow dr = (CLAS.JudgmentAccountRow)row;
            string ObjectName          = this.myJudgmentAccountDT.TableName;

            dr.JudgmentAccountID = this.myA.AtMng.PKIDGet(ObjectName, 1);

            dr.CostAmount = 0;
            dr.PrincipalAmountBeforeJudgment = 0;
            dr.PreJudgmentInterestAmount     = 0;
        }
Ejemplo n.º 6
0
 private void judgmentAccountBindingSource_CurrentChanged(object sender, EventArgs e)
 {
     try
     {
         CLAS.JudgmentAccountRow dr = CurrentRowJudgmentAccount();
         ApplyJudgementAccountSecurity(dr);
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
Ejemplo n.º 7
0
        public override bool CanDelete(DataRow dr)
        {
            bool ok = false;

            CLAS.JudgmentAccountRow fo = (CLAS.JudgmentAccountRow)dr;
            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(myA.FM.CurrentFileId, atSecurity.SecurityManager.Features.JudgmentAccount);
            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            return(ok);
        }
Ejemplo n.º 8
0
        protected override void AfterChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myJudgmentAccountDT.TableName;

            CLAS.JudgmentAccountRow dr = (CLAS.JudgmentAccountRow)ddr;
            switch (dc.ColumnName)
            {
            case JudgmentAccountFields.CostAmount:
            case JudgmentAccountFields.PreJudgmentInterestAmount:
            case JudgmentAccountFields.PrincipalAmountBeforeJudgment:
                if (!dr.IsCostAmountNull() && !dr.IsPreJudgmentInterestAmountNull() && !dr.IsPrincipalAmountBeforeJudgmentNull())
                {
                    dr.JudgmentAmount = dr.CostAmount + dr.PreJudgmentInterestAmount + dr.PrincipalAmountBeforeJudgment;
                    dr.EndEdit();
                }
                break;

            case "Include":
                break;
            }
        }
Ejemplo n.º 9
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myJudgmentAccountDT.TableName;

            CLAS.JudgmentAccountRow dr = (CLAS.JudgmentAccountRow)ddr;
            switch (dc.ColumnName)
            {
            case "CostDate":
                if (dr.IsCostDateNull())
                {
                    throw new RequiredException(Resources.JudgmentAccountCostDate);
                }
                if (dr.JudgmentRow.IsJudgmentDateNull())
                {
                    throw new RelatedException(Resources.JudgmentAccountCostDate, Resources.JudgmentJudgmentDate);
                }
                myA.IsValidDate(Resources.JudgmentAccountCostDate, dr.CostDate, true, dr.JudgmentRow.JudgmentDate, DateTime.Today, Resources.JudgmentJudgmentDate, Resources.ValidationToday);
                break;

            case "CostAmount":
                if (!dr.IsCostAmountNull() && (dr.CostAmount < 0))
                {
                    throw new AtriumException(Resources.MustBeGreaterThanZero, Resources.JudgmentAccountCostAmount);
                }
                if (!dr.IsCostAmountNull() && dr.CostAmount > 40000)
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.CostShouldNotBeGreaterThanX);
                }
                break;

            case "InterestIncluded":
                break;

            case "JudgmentAmount":
                if (dr.JudgmentAmount != dr.CostAmount + dr.PreJudgmentInterestAmount + dr.PrincipalAmountBeforeJudgment)
                {
                    throw new AtriumException(Resources.JudgmentAccountInvalidJudgAmt);
                }

                if (!dr.IsJudgmentAmountNull() && (dr.JudgmentAmount < 0))
                {
                    throw new AtriumException(Resources.MustBeGreaterThanZero, Resources.JudgmentAccountJudgmentAmount);
                }
                if (!dr.IsJudgmentAmountNull() && (dr.JudgmentAmount > 100000))
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.JudgmentAmountShouldNotBeGreaterThanX);
                }
                break;

            case "PostJudgmentInterestRate":
                if (dr.IsPostJudgmentInterestRateNull() || dr.PostJudgmentInterestRate > 60 || dr.PostJudgmentInterestRate < 0)
                {
                    throw new AtriumException(Resources.InvalidInterestRate, Resources.JudgmentAccountPostJudgmentInterestRate);
                }
                break;

            case "PreJudgmentInterestRate":
                if (dr.IsPreJudgmentInterestRateNull() || dr.PreJudgmentInterestRate > 60 || dr.PreJudgmentInterestRate < 0)
                {
                    throw new AtriumException(Resources.InvalidInterestRate, Resources.JudgmentAccountPreJudgmentInterestRate);
                }
                break;

            case "PostJudgmentRateType":
                if (!myA.CheckDomain(dr.PostJudgmentRateType, myA.FM.Codes("InterestRateType")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Interest Rate Type");
                }
                break;

            case "PreJudgmentInterestAmount":
                if (!dr.IsPreJudgmentInterestAmountNull() && (dr.PreJudgmentInterestAmount > 100000))
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.AmountNotGreaterThan, "Pre-Judgment Interest Amount", 100000);
                }
                break;

            case "PreJudgmentRateType":
                if (!myA.CheckDomain(dr.PreJudgmentRateType, myA.FM.Codes("InterestRateType")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Interest Rate Type");
                }
                break;

            case "PrincipalAmountBeforeJudgment":
                if (!dr.IsPrincipalAmountBeforeJudgmentNull() && (dr.PrincipalAmountBeforeJudgment > 100000))
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.AmountNotGreaterThan, "Principal Amount Before Judgment", 100000);
                }
                break;

            default:
                break;
            }
        }