コード例 #1
0
 public override System.Collections.Generic.List <int> Accounts(int id)
 {
     CLAS.DebtRow ahr = myDebtDT.FindByDebtId(id);
     System.Collections.Generic.List <int> l = new System.Collections.Generic.List <int>();
     l.Add(ahr.FileAccountId);
     return(l);
 }
コード例 #2
0
        protected override void BeforeUpdate(DataRow row)
        {
            base.BeforeUpdate(row);
            CLAS.DebtRow dr = (CLAS.DebtRow)row;

            //this.BeforeChange(dr.Table.Columns["MostRecentPCACode"],dr);
            this.BeforeChange(dr.Table.Columns["InterestRate"], dr);
            this.BeforeChange(dr.Table.Columns["LPCode"], dr);
            this.BeforeChange(dr.Table.Columns["PrincipalAmount"], dr);
            this.BeforeChange(dr.Table.Columns["CurrentTo"], dr);
            this.BeforeChange(dr.Table.Columns["LPExpires"], dr);

            //opponentid on file is debtor
            //load account
            DataRow acctR = this.AccountTypeInfo(dr.AccountTypeId);

            CLAS.DebtorRow ddr = this.myA.GetDebtor().FindLoad(myA.FM.CurrentFile.OpponentID);

            if (ddr == null)
            {
                //must have a debtor if there is a debt
                throw new AtriumException("There must be a debtor to have a debt");
            }
            else
            {
                if (acctR["ProgramCode"].ToString() == "CSLP")
                {
                    if (ddr.IsCeasedToBeStudentDateNull())
                    {
                        throw new RequiredException(Resources.DebtPSED);
                    }

                    //JLL: still valid? 2014-03-10
                    //if (dr.IsDARSOccurenceDateNull())
                    //    throw new RequiredException(Resources.DebtDARSOccuranceDate);
                }
                else if (acctR["ProgramCode"].ToString() == "ISP")
                {
                    if (dr.IsInvoiceNumberNull())
                    {
                        throw new RequiredException(Resources.DebtInvoiceNumber);
                    }
                }
                //else if (acctR["ProgramCode"].ToString() == "EI")
                //{
                //    if (dr.IsSequenceBalanceNull() )
                //        throw new RequiredException(Resources.DebtSequenceBalance);
                //}
                else if (acctR["ProgramCode"].ToString() == "EP")
                {
                }
                else if (acctR["ProgramCode"].ToString() == "FAS")
                {
                }
            }
        }
コード例 #3
0
        protected override void AfterUpdate(DataRow dr)
        {
            CLAS.DebtRow r = (CLAS.DebtRow)dr;

            System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
            xd.InnerXml = myA.FM.CurrentFile.FileStructXml;
            MyXml(r, xd);
            myA.FM.CurrentFile.FileStructXml = xd.InnerXml;
            //myA.EFile.Update();
        }
コード例 #4
0
        public override void ApplySecurity(DataRow dr)
        {
            CLAS.DebtRow cbr      = (CLAS.DebtRow)dr;
            bool         okToEdit = FM.GetCLASMng().GetDebt().CanEdit(cbr);

            UIHelper.EnableControls(debtBindingSource, okToEdit);
            UIHelper.EnableCommandBarCommand(tsDelete, FM.GetCLASMng().GetDebt().CanDelete(cbr));

            accountHistoryGridEX.RootTable.Columns["colDelete"].Visible = okToEdit;
        }
コード例 #5
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();
            }
        }
コード例 #6
0
        protected override void AfterChange(DataColumn dc, DataRow ddr)
        {
            base.AfterChange(dc, ddr);
            string ObjectName = this.myDebtDT.TableName;

            CLAS.DebtRow dr = (CLAS.DebtRow)ddr;
            switch (dc.ColumnName)
            {
            case DebtFields.InterestAmount:
            case DebtFields.PrincipalAmount:
                dr.CurrentLiability = (dr.IsInterestAmountNull()? 0: dr.InterestAmount) + (dr.IsPrincipalAmountNull()? 0: dr.PrincipalAmount);
                dr.EndEdit();
                break;

            case DebtFields.MSOAOverDARS:
                if (dr.MSOAOverDARS)
                {
                    dr.StatementRequest = false;
                }
                dr.EndEdit();

                break;

            case DebtFields.DebtId:
                dr.FileAccountId = dr.DebtId;
                dr.EndEdit();
                break;

            case "FileAccountId":
                dr.DebtId = dr.FileAccountId;
                dr.EndEdit();
                break;

            case DebtFields.LPExpires:
                myA.FM.GetActivityBF().MaintainBFDate(dr.DebtId, "DEBT", "CURRENTLPDATE", dr.LPExpires);

                CLAS.AccountHistoryRow[] ahrs = (CLAS.AccountHistoryRow[])myA.DB.AccountHistory.Select("ReceivedFromOfficeDate is null and FileAccountId=" + dr.DebtId.ToString());
                if (ahrs.Length > 0)
                {
                    myA.FM.GetActivityBF().MaintainBFDate(ahrs[0].AccountHistoryId, "ACCOUNTHISTORY", "CURRENTLPDATE", dr.LPExpires);
                }

                //jll: 2014-05-30 set stat barred
                dr.StatBarred = dr.LPExpires < DateTime.Today;

                if (dr.StatBarred)
                {
                    dr.ActiveWithJustice = false;
                }
                dr.EndEdit();

                break;
            }
        }
コード例 #7
0
        private void MyXml(CLAS.DebtRow r, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='account' and @id=" + r.FileAccountId.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "account");
                xe.SetAttribute("supertype", "debt");
            }

            string dType = "DARS";

            if (r.MSOAOverDARS)
            {
                dType = "MSOA";
            }
            if (r.StatBarred)
            {
                dType = Properties.Resources.TocDebtStatuteBarred;
            }

            xe.SetAttribute("id", r.FileAccountId.ToString());
            xe.SetAttribute("titlee", r["AccountTypeCode"].ToString() + " (" + r["DARSAccountType"].ToString() + ") - " + dType);
            xe.SetAttribute("titlef", r["AccountTypeCode"].ToString() + " (" + r["DARSAccountType"].ToString() + ") - " + dType);

            if (r.ActiveWithJustice)
            {
                xe.SetAttribute("tooltipe", r["AccountTypeDescEng"].ToString() + " / Active");
                xe.SetAttribute("tooltipf", r["AccountTypeDescEng"].ToString() + " / Actif");
                xe.SetAttribute("strikeout", "false");
            }
            else
            {
                if (r.StatBarred)
                {
                    xe.SetAttribute("tooltipe", r["AccountTypeDescEng"].ToString() + " / Statute-Barred");
                    xe.SetAttribute("tooltipf", r["AccountTypeDescEng"].ToString() + " / Prescrit");
                }
                else
                {
                    xe.SetAttribute("tooltipe", r["AccountTypeDescEng"].ToString() + " / Non-Active");
                    xe.SetAttribute("tooltipf", r["AccountTypeDescEng"].ToString() + " / Non actif");
                }

                xe.SetAttribute("strikeout", "true");
            }

            if (xe.ParentNode == null)
            {
                System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "account", "Accounts", "Comptes", 220);
                xes.AppendChild(xe);
            }
        }
コード例 #8
0
        public override bool CanDelete(DataRow dr)
        {
            bool ok = false;

            CLAS.DebtRow fhr = (CLAS.DebtRow)dr;
            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(fhr.FileId, atSecurity.SecurityManager.Features.Debt);
            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            return(ok);
        }
コード例 #9
0
        protected override void AfterAdd(DataRow row)
        {
            base.AfterAdd(row);
            CLAS.DebtRow dr         = (CLAS.DebtRow)row;
            string       ObjectName = this.myDebtDT.TableName;

            dr.FileId                = myA.FM.CurrentFileId;
            dr.DebtId                = dr.FileAccountId;
            dr.OfficeID              = myA.FM.CurrentFile.LeadOfficeId;
            dr.MSOAOverDARS          = false;
            dr.MSOARequest           = false;
            dr.StatementRequest      = false;
            dr.ReceivedByJusticeDate = myA.FM.CurrentFile.OpenedDate;
            dr.StatBarred            = false;
        }
コード例 #10
0
 protected override void BeforeUpdate(DataRow ddr)
 {
     CLAS.AccountHistoryRow dr = (CLAS.AccountHistoryRow)ddr;
     if (this.myA.GetFileHistory().GetCurrentRow().Length != 0)
     {
         if (((CLAS.FileHistoryRow) this.myA.GetFileHistory().GetCurrentRow()[0]).IsReceivedByOfficeDateNull())
         {
             if (!dr.IsReceivedByOfficeDateNull())
             {
                 throw new AtriumException(Resources.FileNotReceived);
             }
         }
     }
     if (dr.IsReceivedByOfficeDateNull())
     {
         CLAS.DebtRow cddr = myA.DB.Debt.FindByDebtId(dr.FileAccountID);
         cddr.OfficeID = dr.OfficeId;
     }
 }
コード例 #11
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            base.BeforeChange(dc, ddr);
            string ObjectName = this.myDebtDT.TableName;

            CLAS.DebtRow dr = (CLAS.DebtRow)ddr;
            DataRow      acctR;

            switch (dc.ColumnName)
            {
            case "AccountTypeId":
                if (!myA.CheckDomain(dr.AccountTypeId, myA.FM.Codes("vaccounttypelist")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dc.Table.TableName, "Account Type List");
                }
                break;

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

            case DebtFields.DARSOccurenceDate:
                if (dr.IsDARSOccurenceDateNull() & dr.AccountTypeCode == "CSL")
                {
                    throw new RequiredException(Resources.DebtDARSOccuranceDate);
                }
                break;

            case "InvoiceNumber":
                if (dr.IsInvoiceNumberNull() & (dr.AccountTypeCode == "CPP" | dr.AccountTypeCode == "OAS"))
                {
                    throw new RequiredException(Resources.DebtInvoiceNumber);
                }
                break;

            //case "SequenceBalance":
            //    if (dr.IsSequenceBalanceNull() & dr.AccountTypeCode == "EI")
            //        throw new RequiredException(Resources.DebtSequenceBalance);
            //    break;
            case "StatementRequest":
                if (dr.MSOAOverDARS && dr.StatementRequest)
                {
                    throw new AtriumException(Resources.MSOAOverDARS);
                }
                break;

            case "InterestRate":
                if (dr.IsInterestRateNull() || dr.InterestRate > 60 || dr.InterestRate < 0)
                {
                    throw new AtriumException(Resources.InvalidInterestRate, Resources.DebtInterestRate);
                }
                break;

            case "PrincipalAmount":
                if (dr.IsPrincipalAmountNull())
                {
                    throw new RequiredException(Resources.DebtPrincipalAmount);
                }
                else if (dr.PrincipalAmount > 100000)
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.AmountNotGreaterThan, "Principal amount", 100000);
                }
                break;

            case "InterestAmount":
                if (!dr.IsInterestAmountNull() && dr.InterestAmount > 100000)
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.AmountNotGreaterThan, "Interest amount", 100000);
                }
                break;

            case "CurrentLiability":
                if (!dr.IsCurrentLiabilityNull() && dr.CurrentLiability > 100000)
                {
                    RaiseWarning(WarningLevel.Interrupt, Properties.Resources.AmountNotGreaterThan, "Current liability", 100000);
                }
                break;

            case "LPCode":
                acctR = this.AccountTypeInfo(dr.AccountTypeId);
                if (dr.IsLPCodeNull() && (acctR["AccountTypeCode"].ToString() != "CPP" && acctR["AccountTypeCode"].ToString() != "OAS"))
                {
                    throw new RequiredException(Resources.DebtLPCode);
                }
                else if (!myA.CheckDomain(dr.LPCode, myA.FM.Codes("LP")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Limitation Period Code");
                }
                break;

            case "CurrentTo":
                if (dr.IsCurrentToNull())
                {
                    throw new RequiredException(Resources.DebtCurrentTo);
                }
                myA.IsValidDate(Resources.DebtCurrentTo, dr.CurrentTo, false, DebtorBE.CSLBegin, DateTime.Today, Resources.ValidationCSLBegin, Resources.ValidationToday);
                break;

            case "InterestFromDate":
                if (!dr.IsInterestFromDateNull())
                {
                    myA.IsValidDate(Resources.DebtInterestFromDate, dr.InterestFromDate, true, DebtorBE.CSLBegin, DateTime.Today, Resources.ValidationCSLBegin, Resources.ValidationToday);
                }
                //this.myA.RaiseError((int)AtriumEnum.AppErrorCodes.CannotBeBlank, myA.GetLabelLeft(ObjectName, dc.ColumnName));
                break;

            case "LPDate":
                acctR = this.AccountTypeInfo(dr.AccountTypeId);
                if (dr.IsLPDateNull() && (acctR["AccountTypeCode"].ToString() != "CPP" && acctR["AccountTypeCode"].ToString() != "OAS"))
                {
                    throw new RequiredException(Resources.DebtLPDate);
                }
                myA.IsValidDate(Resources.DebtLPDate, dr.LPDate, false, DebtorBE.CSLBegin, DateTime.Today, Resources.ValidationCSLBegin, Resources.ValidationToday);
                break;

            case "LPExpires":
                acctR = this.AccountTypeInfo(dr.AccountTypeId);
                if (dr.IsLPExpiresNull() && (acctR["AccountTypeCode"].ToString() != "CPP" && acctR["AccountTypeCode"].ToString() != "OAS"))
                {
                    throw new RequiredException(Resources.DebtLPExpires);
                }

                if (!dr.IsLPDateNull())
                {
                    myA.IsValidDate(Resources.DebtLPExpires, dr.LPExpires, false, dr.LPDate, DateTime.Today.AddYears(20), Resources.DebtLPDate, Resources.Validation20YearsLater);
                }
                break;

            default:
                break;
            }
        }