Exemple #1
0
        protected override void AfterAdd(DataRow row)
        {
            CLAS.InsolvencyRow dr         = (CLAS.InsolvencyRow)row;
            string             ObjectName = this.myInsolvencyDT.TableName;

            dr.InsolvencyID        = this.myA.AtMng.PKIDGet(ObjectName, 1);
            dr.FileID              = myA.FM.CurrentFile.FileId;
            dr.OfficeID            = myA.FM.CurrentFile.LeadOfficeId;
            dr.StayOfProceeding    = true;
            dr.CSLNonDischargeable = false;
            CLAS.DebtorRow ddr = this.myA.GetDebtor().FindLoad(myA.FM.CurrentFile.OpponentID);
            dr.CeasedToBeStudentDate = ddr.CeasedToBeStudentDate;

            InsolvencyAccountBE jaBE = this.myA.GetInsolvencyAccount();

            foreach (CLAS.DebtRow debtr in this.myA.DB.Debt)
            {
                if (debtr.ActiveWithJustice) //  && debtr.OfficeID==debtr.EFileRow.LeadOfficeId) JLL 2010-08-11 Review this check
                {
                    CLAS.InsolvencyAccountRow jar = (CLAS.InsolvencyAccountRow)jaBE.Add(dr);
                    jar.BeginEdit();
                    jar.FileAccountID = debtr.FileAccountId;
                    jar.Include       = true;
                    jar.EndEdit();
                }
            }
        }
Exemple #2
0
        //public void LoadBySIN(string SIN)
        //{
        //    //implement loadbysin on debtordal
        //    //Fill(myA.DALMngr.ContactLoadBySIN(SIN));
        //}

        public CLAS.DebtorRow FindLoad(int DebtorId)
        {
            CLAS.DebtorRow dr = myDebtorDT.FindByDebtorId(DebtorId);
            if (dr != null)
            {
                return(dr);
            }
            else
            {
                if (myA.AtMng.AppMan.UseService)
                {
                    Fill(myA.AtMng.AppMan.AtriumX().DebtorLoad(DebtorId, myA.AtMng.AppMan.AtriumXCon));
                }
                else
                {
                    try
                    {
                        Fill(myDAL.Load(DebtorId));
                    }
                    catch (System.Runtime.Serialization.SerializationException x)
                    {
                        RecoverDAL();
                        Fill(myDAL.Load(DebtorId));
                    }
                }

                return(myDebtorDT.FindByDebtorId(DebtorId));
            }
        }
Exemple #3
0
        protected override void BeforeUpdate(DataRow row)
        {
            base.BeforeUpdate(row);
            CLAS.DebtorRow dr = (CLAS.DebtorRow)row;
            this.BeforeChange(dr.Table.Columns["CeasedToBeStudentDate"], dr);
            this.BeforeChange(row.Table.Columns["SIN"], row);
            if (dr.IsNull(atriumBE.ContactFields.SIN))
            {
                throw new RequiredException(Resources.DebtorSIN);
            }


            if (row.RowState != DataRowState.Added && (!row["SIN", DataRowVersion.Original].Equals(row["SIN", DataRowVersion.Current]) || !row["LastName", DataRowVersion.Original].Equals(row["LastName", DataRowVersion.Current]) || !row["FirstName", DataRowVersion.Original].Equals(row["FirstName", DataRowVersion.Current])))
            {
                this.myA.FM.GetAKA();

                atriumDB.AKARow drAka = this.myA.FM.DB.AKA.NewAKARow();
                this.myA.FM.DB.AKA.AddAKARow(drAka);
                drAka.BeginEdit();
                drAka.LastName  = row["LastName", DataRowVersion.Original].ToString();
                drAka.FirstName = row["FirstName", DataRowVersion.Original].ToString();
                drAka.SIN       = row["SIN", DataRowVersion.Original].ToString();
                drAka.ContactId = (int)row["ContactId"];
                drAka.EndEdit();
            }

            if (this.myA.FM.CurrentFile.OpponentID == (int)row["ContactId"])
            {
                this.myA.FM.CurrentFile.NameE = String.Format("{0}, {1}", row["LastName"], row["FirstName"]);
                this.myA.FM.CurrentFile.NameF = String.Format("{0}, {1}", row["LastName"], row["FirstName"]);
            }
        }
Exemple #4
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            base.BeforeChange(dc, ddr);
            string ObjectName = this.myDebtorDT.TableName;

            CLAS.DebtorRow dr = (CLAS.DebtorRow)ddr;
            switch (dc.ColumnName)
            {
            case "AddressCurrentID":
                if (ddr.IsNull(dc))
                {
                    throw new AtriumException(Resources.DebtAddressRqd);
                }
                break;

            case "SexCode":
                if (ddr.IsNull(dc))
                {
                    throw new RequiredException(Resources.DebtorSexCode);
                }
                if (!dr.IsNull("SexCode") && !myA.CheckDomain(dr.SexCode, myA.FM.Codes("Sex")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Gender Code");
                }
                break;

            case "LanguageCode":
                if (ddr.IsNull(dc))
                {
                    throw new RequiredException(Resources.DebtorLanguageCode);
                }
                else if (!myA.CheckDomain(dr.LanguageCode, myA.FM.Codes("LanguageCode")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Language Code");
                }
                break;

            case "BirthDate":
                if (ddr.IsNull(dc))
                {
                    throw new RequiredException(Resources.DebtorBirthDate);
                }

                myA.IsValidDate(Resources.DebtorBirthDate, (System.DateTime)ddr[dc], false, DateTime.Today.AddYears(-100), DateTime.Today.AddYears(-15), Resources.Validation100yearsago, Resources.Validation15yearsago);
                break;

            case "CeasedToBeStudentDate":
                if (!dr.IsCeasedToBeStudentDateNull())
                {
                    myA.IsValidDate(Resources.DebtorCeasedToBeStudentDate, dr.CeasedToBeStudentDate, false, DebtorBE.CSLBegin, DateTime.Today, Resources.ValidationCSLBegin, Resources.ValidationToday);
                }
                break;

            default:
                break;
            }
        }
Exemple #5
0
 protected override void AfterUpdate(DataRow dr)
 {
     CLAS.DebtorRow         debtor = (CLAS.DebtorRow)dr;
     System.Xml.XmlDocument xd     = new System.Xml.XmlDocument();
     xd.InnerXml = myA.FM.CurrentFile.FileStructXml;
     myA.FM.GetFileContact().MyXml(myA.FM.CurrentFile, xd);
     myA.FM.CurrentFile.FileStructXml = xd.InnerXml;
     //myA.EFile.Update();
 }
Exemple #6
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")
                {
                }
            }
        }
Exemple #7
0
        public override void ApplySecurity(DataRow dr)
        {
            CLAS.DebtorRow cbr      = (CLAS.DebtorRow)dr;
            bool           okToEdit = FM.GetCLASMng().GetDebtor().CanEdit(cbr);

            UIHelper.EnableControls(debtorBindingSource, okToEdit);

            addressGridEX.RootTable.Columns["colDelete"].Visible = okToEdit;
            aKAGridEX.RootTable.Columns["colDelete"].Visible     = okToEdit;
        }
Exemple #8
0
        private DataRow AddX(CLAS.DebtorRow cr)
        {
            atriumDB.AddressRow dr = (atriumDB.AddressRow)base.Add(cr);

            dr.ContactId = cr.ContactId;
            if (cr.IsAddressCurrentIDNull())
            {
                cr.AddressCurrentID = dr.AddressId;
            }

            return(dr);
        }
Exemple #9
0
        //public override DataRow[] GetParentRow()
        //{
        //    //load all rows so that effective date calc works


        //    //---JLL START
        //    //2010-08-09 cast fails when on one line, moving it to two seems to do the trick ... ??
        //    // broke it up on two lines, cast is fine.

        //    //atriumDB.DebtorRow[] drs=(atriumDB.DebtorRow[])myA.GetDebtor().GetCurrentRow();

        //    DataRow[] dr = myA.GetCLASMng().GetDebtor().GetCurrentRow();
        //    atriumDB.DebtorRow[] drs = (atriumDB.DebtorRow[])dr;
        //    //--JLL END


        //    if (drs.Length == 1)
        //        LoadByContactId(drs[0].ContactId);
        //    if (drs.Length == 0)
        //        return null;
        //    else
        //        return drs;
        //}

        public override DataRow[] GetCurrentRow()
        {
            if (!this.myA.CurrentFile.IsOpponentIDNull())
            {
                CLAS.DebtorRow dr = (CLAS.DebtorRow)myA.GetCLASMng().GetDebtor().CurrentDebtor;
                LoadByContactId(dr.ContactId);
                return(new DataRow[] { myAddressDT.FindByAddressId(dr.AddressCurrentID) });
            }
            else
            {
                return(base.GetCurrentRow());
            }
        }
Exemple #10
0
        protected override void AfterAdd(DataRow row)
        {
            base.AfterAdd(row);
            CLAS.DebtorRow dr         = (CLAS.DebtorRow)row;
            string         ObjectName = this.myDebtorDT.TableName;

            dr.DebtorId          = dr.ContactId;;
            dr.AddressNotCurrent = false;
            dr.SIN          = "";
            dr.ContactClass = "D";

            this.myA.FM.CurrentFile.OpponentID = dr.DebtorId;
        }
Exemple #11
0
        public override bool CanEdit(DataRow dr)
        {
            bool ok = false;

            CLAS.DebtorRow fhr = (CLAS.DebtorRow)dr;
            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanUpdate(myA.FM.CurrentFileId, atSecurity.SecurityManager.Features.Debtor);
            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            return(ok);
        }
Exemple #12
0
 private void ValidateLastKnownAddress(DataRow dr)
 {
     CLAS.DebtorRow cbr = (CLAS.DebtorRow)dr;
     if (cbr.AddressNotCurrent)
     {
         uiCheckBox1.ForeColor = Color.Red;
         uiCheckBox1.Image     = Properties.Resources.warning_16x16;
     }
     else
     {
         uiCheckBox1.ForeColor = SystemColors.ControlText;
         uiCheckBox1.Image     = null;
     }
 }
Exemple #13
0
        private void MyXml(atriumDB.FileContactRow fcr, System.Xml.XmlDocument xd)
        {
            try
            {
                //JLL: MODIFIED 2009/07/24: take FileContact.Active into account - remove where not active
                bool removeNode = false;
                if (!fcr.HideInToc)
                {
                    System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@supertype='contact' and @id=" + fcr.FileContactid.ToString() + "]");

                    if (!fcr.Active)
                    {
                        removeNode = true;
                    }
                    else if (xe == null)
                    {
                        xe = xd.CreateElement("toc");
                        xe.SetAttribute("supertype", "contact");
                    }


                    if (removeNode)
                    {
                        RemoveFileContactFromXML(xe);
                    }
                    else
                    {
                        xe.SetAttribute("id", fcr.FileContactid.ToString());
                        //if (fcr.IsLastNameNull())
                        //{
                        //    xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LegalName, ""));
                        //    xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LegalName, ""));
                        //}
                        //else
                        //{
                        //    xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LastName, fcr.FirstName));
                        //    xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LastName, fcr.FirstName));
                        //}

                        xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.DisplayName, ""));
                        xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.DisplayName, ""));

                        if (fcr.ContactType == "FDB")
                        {
                            CLAS.DebtorRow debtor = myA.GetCLASMng().GetDebtor().CurrentDebtor;

                            xe.SetAttribute("type", "opponent");
                            //check for Contact/Notes
                            if (debtor != null && !debtor.IsNotesNull())
                            {
                                //tweek title
                                xe.SetAttribute("titlee", "*** " + xe.GetAttribute("titlee") + " ***");
                                xe.SetAttribute("titlef", "*** " + xe.GetAttribute("titlef") + " ***");
                                xe.SetAttribute("bold", "true");
                                xe.SetAttribute("tooltipe", "There are notes");
                                xe.SetAttribute("tooltipf", "Il y a des notes");
                            }
                            else
                            {
                                xe.SetAttribute("bold", "false");
                                xe.SetAttribute("tooltipe", "");
                                xe.SetAttribute("tooltipf", "");
                            }
                            //2014-06-11
                            //JLL
                            //calculate address country to determine icon
                            //assumes data is already loaded
                            //DOES NOT WORK WHEN OPENING A FILE; CONTACT ROW IS NULL ... ARG
                            if (debtor != null && !debtor.IsAddressCurrentIDNull())
                            {
                                atriumDB.AddressRow dbAddress = myA.DB.Address.FindByAddressId(debtor.AddressCurrentID);
                                if (dbAddress != null)
                                {
                                    string country = dbAddress.CountryCode;
                                    switch (country)
                                    {
                                    case "CDN":
                                        xe.SetAttribute("icon", "34");
                                        break;

                                    case "USA":
                                        xe.SetAttribute("icon", "35");
                                        break;

                                    default:
                                        xe.SetAttribute("icon", "36");
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            xe.SetAttribute("type", "contact");
                        }

                        if (xe.GetAttribute("isParticipant") != "true" && !fcr.IsOfficeIdNull())
                        {
                            xe.SetAttribute("icon", "43"); //atrium officer; not necessarily a user
                        }
                        if (xe.ParentNode == null)
                        {
                            System.Xml.XmlElement xes = null;
                            if (fcr.IsOfficeIdNull())
                            {
                                xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210);
                                xes.AppendChild(xe);
                            }
                            else
                            {
                                System.Xml.XmlElement xe1 = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='fileoffice' and @officeid=" + fcr.OfficeId.ToString() + "]");
                                if (xe1 != null)
                                {
                                    xe1.AppendChild(xe);
                                }
                                else
                                {
                                    xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210);
                                    xes.AppendChild(xe);
                                }
                                //xes.AppendChild(xe);

                                //xes = EFileBE.XmlAddFld(xe1, "contacts", "Contacts", "Contacts", 320);
                                //else

                                //{
                                //JLL: Bug 2009/07/24
                                //When new contact is added through process (CM03.02), and no File Office record is present,
                                // it sticks File Contact record on first "contact" match on filestructxml document
                                //    xes = EFileBE.XmlAddFld(xd, "contacts", "Contacts", "Contacts", 320);
                                //}
                            }
                            //xes.AppendChild(xe);
                        }
                    }
                }
            }
            catch (Exception x)
            { }
        }
Exemple #14
0
 private void debtorBindingSource_CurrentChanged(object sender, EventArgs e)
 {
     CLAS.DebtorRow dr = CurrentRow();
     ApplySecurity(dr);
 }