protected override void BeforeUpdate(DataRow row) { atriumDB.AddressRow dr = (atriumDB.AddressRow)row; Validate(row); if (dr.HasErrors) { throw new AtriumException(ErrorsForTable(myDT)); } if (!myA.CurrentFile.IsOpponentIDNull() && dr.AddressType == "RE") { //COMMENTED OUT. DON'T NEED TO AUTO UPDATE VALUE OF "CURRENT" ANYMORE, RELFIELDS SHOULD HANDLE IT. //WTF????? //NOW there is an item in TFS to restore this. What is the expected behaviour??? // //check to see if this address has the most recent effective to atriumDB.AddressRow max = dr; foreach (atriumDB.AddressRow add in myAddressDT.Select("ContactId=" + myA.CurrentFile.OpponentID.ToString())) { if (add.AddressType == "RE") { if (add.IsCurrentNull() || add.Current) { add.Current = false; } if (add.EffectiveTo > max.EffectiveTo) { max = add; } } } // if (dr.EffectiveTo >= max.EffectiveTo) myA.GetCLASMng().GetDebtor().CurrentDebtor.AddressCurrentID = max.AddressId; max.Current = true; } }
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) { } }
public void LoadTOC() { pnlDockTop.Height = defaultTopHeight; if (fmCurrent.DB.FileXRef.Select("LinkType=0 and fileid=" + fmCurrent.CurrentFileId.ToString()).Length > 0) { pnlBrowseFiles.Enabled = true; } else { pnlBrowseFiles.Enabled = false; } if (fmCurrent.DB.FileXRef.Select("LinkType=1").Length > 0 || fmCurrent.DB.FileXRef.Select("LinkType=2 and fileid=" + fmCurrent.CurrentFileId).Length > 0) { pnlXRefs.Enabled = true; } else { pnlXRefs.Enabled = false; } SetTooltipsForLinks(); SetFileStatusColor(fmCurrent.CurrentFile.StatusCode); officeDB.OfficeRow orOwnerOffice = null; try { orOwnerOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).CurrentOffice; lnkJumpToOwnerFile.Tag = orOwnerOffice.OfficeFileId; lnkJumpToOwnerFile.Enabled = (orOwnerOffice.OfficeFileId != fileId); } catch (Exception xoo) { lnkJumpToOwnerFile.Enabled = false; } officeDB.OfficeRow orLeadOffice = null; if (!fmCurrent.CurrentFile.IsLeadOfficeIdNull()) { try { orLeadOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.LeadOfficeId).CurrentOffice; lnkJumpToLeadFile.Visible = true; lnkJumpToLeadFile.Tag = orLeadOffice.OfficeFileId; lnkJumpToLeadFile.Enabled = (orLeadOffice.OfficeFileId != fileId); } catch (Exception xlo) { lnkJumpToLeadFile.Enabled = false; } } else { lnkJumpToLeadFile.Visible = false; } if (!fmCurrent.CurrentFile.IsFullFileNumberNull()) { lblFullNumberValue.Text = fmCurrent.CurrentFile.FullFileNumber; } else { lblFullNumberValue.Text = ""; } lblFilenameValue.Text = fmCurrent.CurrentFile.Name; atriumDB.ActivityRow ar = fmCurrent.GetActivity().GetCurrentCaseStatus(DateTime.Today.AddDays(100)); int csId = 0; if (ar != null) { csId = ar.CaseStatusId; lblStatusDateValue.Text = ar.ActivityDate.ToString("yyyy/MM/dd"); } else { lblStatusDateValue.Text = "N/A"; } // WI 75873 DataRow drProgram = null; if (programId > 0) { DataTable dt = Atmng.GetFile().Codes("Dim2"); DataRow[] dr = dt.Select("ProgramId = " + programId.ToString()); drProgram = dr[0]; appDB.ddLookupRow dlr = (appDB.ddLookupRow)Atmng.DB.ddLookup.Select("LookupName='Dim2'")[0]; lblProgram.Text = dlr["Description" + Atmng.AppMan.Language].ToString(); } else { lblProgram.Visible = false; lblProgramValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } // -- End // WI 75873 //Shared Folder START lblSharedFolder.Visible = false; lnkSharedFolder.Visible = false; string sharedPath = string.Empty; if (programId == 3) { sharedPath = Atmng.GetSetting(AppStringSetting.DataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } else if (programId == 2) { sharedPath = Atmng.GetSetting(AppStringSetting.ISDataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } if (sharedPath != string.Empty && System.IO.Directory.Exists(sharedPath)) { lnkSharedFolder.Text = sharedPath; lblSharedFolder.Visible = true; lnkSharedFolder.Visible = true; } else { pnlDockTop.Height -= defaultRowHeight; } //Shared Folder END lblTypeValue.Text = fmCurrent.AtMng.CodeDB.FileType.FindByFileTypeCode(fmCurrent.CurrentFile.FileType)["FileTypeDesc" + Atmng.AppMan.languageCamel].ToString(); lblStatusValue.Text = fmCurrent.AtMng.CodeDB.Status.FindByStatusCode(fmCurrent.CurrentFile.StatusCode)["StatusDesc" + Atmng.AppMan.languageCamel].ToString(); lblCaseStatusValue.Text = fmCurrent.AtMng.CodeDB.CaseStatus.FindByCaseStatusId(csId)["CaseStatusDesc" + Atmng.AppMan.languageCamel].ToString(); if (drProgram != null) { lblProgramValue.Text = (string)drProgram["ProgramDescription" + Atmng.AppMan.languageCamel].ToString(); } if (orOwnerOffice != null) { setOfficeTooltip(lnkJumpToOwnerFile, orOwnerOffice); } if (orLeadOffice != null) { setOfficeTooltip(lnkJumpToLeadFile, orLeadOffice); } //CLAS if (fmCurrent.GetCLASMng() != null && !fmCurrent.CurrentFile.IsOpponentIDNull()) { lmDatasets.CLAS.DebtorRow orDB = fmCurrent.GetCLASMng().GetDebtor().FindLoad(fmCurrent.CurrentFile.OpponentID); if (!orDB.IsNull("SIN")) { lblSINValue.Text = atriumBE.DebtorBE.FormattedSIN(orDB.SIN); } else { lblSINValue.Text = ""; } lnkSINLabel.Visible = true; lblSINValue.Visible = true; if (!fmCurrent.CurrentFile.IsLeadParalegalIDNull()) { lmDatasets.officeDB.OfficerRow orPL = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).GetOfficer().FindLoad(fmCurrent.CurrentFile.LeadParalegalID); lblParaLegalValue.Text = orPL.LastName + ", " + orPL.FirstName + " (" + orPL.OfficerCode + ")"; lblParalegal.Visible = true; lblParaLegalValue.Visible = true; } else { lblParaLegalValue.Text = ""; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; } } else { //no CLAS; hide row lnkSINLabel.Visible = false; lblSINValue.Visible = false; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } ParentFile.uiPanel0.Text = fmCurrent.CurrentFile.Name; ucBrowse1.FileContextMenu.UsedInTreeView = false; if (fmCurrent.CurrentFile.FileStructXml != null) { tvContents.Nodes.Clear(); System.Xml.XmlDocument xdToc = new System.Xml.XmlDocument(); xdToc.InnerXml = fmCurrent.CurrentFile.FileStructXml; LoadTOCNode(tvContents.Nodes, xdToc.DocumentElement); tvContents.ExpandAll(); tvContents.Nodes[0].EnsureVisible(); } }