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); }
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) { } }