} // 2010-03-11: BACKWARDS COMPATIBILITY, REMOVED RESIDENTIAL public EntityAddress CurrentAddress(Enumerations.EntityAddressType forAddressType) { EntityAddress entityAddress = null; foreach (EntityAddress currentAddress in Addresses) { if (currentAddress.AddressType == forAddressType) { if ((DateTime.Today >= currentAddress.EffectiveDate) && (DateTime.Today <= currentAddress.TerminationDate)) { entityAddress = currentAddress; break; } } } return(entityAddress); }
public EntityCorrespondence(Application applicationReference, Int64 forEntityId, EntityAddress address, Reference.Correspondence correspondence) { EntityCorrespondenceBaseConstructor(applicationReference, forEntityId, String.Empty, address, correspondence); return; }
protected void EntityCorrespondenceBaseConstructor(Application applicationReference, Int64 forEntityId, String forAttention, EntityAddress address, Reference.Correspondence correspondence) { BaseConstructor(applicationReference); entityId = forEntityId; attention = forAttention; if (address != null) { entityAddressId = address.Id; addressLine1 = address.Line1; addressLine2 = address.Line2; addressCity = address.City; addressState = address.State; addressZipCode = address.ZipCode; addressZipPlus4 = address.ZipPlus4; addressPostalCode = address.PostalCode; } if (correspondence != null) { correspondenceId = correspondence.Id; correspondenceName = correspondence.Name; correspondenceVersion = correspondence.Version; } readyToSendDate = DateTime.Today; sentDate = null; receivedDate = null; returnedDate = null; createAccountInfo = new Mercury.Server.Data.AuthorityAccountStamp(); modifiedAccountInfo = new Mercury.Server.Data.AuthorityAccountStamp(); return; }
override public String EvaluateDataBinding(String bindingContext) { String dataValue = String.Empty; String bindingContextPart = bindingContext.Split('.')[0]; EntityAddress address = null; switch (bindingContextPart) { case "Id": dataValue = Id.ToString(); break; case "EntityType": dataValue = ((Int32)entityType).ToString(); break; case "EntityTypeDescription": dataValue = entityType.ToString(); break; case "Name": dataValue = name; break; case "NameLast": dataValue = nameLast; break; case "NameFirst": dataValue = nameFirst; break; case "NameMiddle": dataValue = nameMiddle; break; case "NamePrefix": dataValue = namePrefix; break; case "NameSuffix": dataValue = nameSuffix; break; case "FederalTaxId": dataValue = federalTaxId; break; case "IdCodeQualifier": dataValue = idCodeQualifier; break; case "UniqueId": dataValue = uniqueId; break; case "CurrentResidentialAddress": case "CurrentPhysicalAddress": case "CurrentMailingAddress": #region Current Address switch (bindingContextPart) { case "CurrentResidentialAddress": address = CurrentPhysicalAddress; break; // BACKWARDS COMPATIBILITY case "CurrentPhysicalAddress": address = CurrentPhysicalAddress; break; case "CurrentMailingAddress": address = CurrentMailingAddress; break; default: address = null; break; } if (address != null) { dataValue = address.EvaluateDataBinding(bindingContext.Replace(bindingContextPart + ".", "")); } else { dataValue = String.Empty; } #endregion break; case "CurrentContactTelephone": case "CurrentContactFacsimile": case "CurrentContactEmail": case "CurrentContactEmergencyPhone": case "CurrentContactCellPhone": // BACKWARDS COMPATIBILITY case "CurrentContactMobilePhone": case "CurrentContactPager": #region Current Contact EntityContactInformation contact = null; switch (bindingContextPart) { case "CurrentContactTelephone": contact = CurrentContactInformation(Enumerations.EntityContactType.Telephone); break; case "CurrentContactFacsimile": contact = CurrentContactInformation(Enumerations.EntityContactType.Facsimile); break; //case "CurrentContactEmail": contact = CurrentContactEmail; break; //case "CurrentContactEmergencyPhone": contact = CurrentContactEmergencyPhone; break; //case "CurrentContactCellPhone": contact = CurrentContactCellPhone; break; // BACKWARDS COMPATIBILITY //case "CurrentContactMobilePhone": contact = CurrentContactCellPhone; break; //case "CurrentContactPager": contact = CurrentContactPager; break; default: contact = null; break; } if (contact != null) { dataValue = contact.EvaluateDataBinding(bindingContext.Replace(bindingContextPart + ".", "")); } else { dataValue = String.Empty; } #endregion break; case "EntityAddresses": #region All Entity Addresses dataValue = "EntityAddress"; foreach (EntityAddress currentAddress in base.application.EntityAddressesGet(Id)) { dataValue = dataValue + "|" + currentAddress.Id.ToString(); } #endregion break; case "EntityContactInformation": #region All Entity Contacts dataValue = "EntityContactInformation"; foreach (EntityContactInformation currentContactInformation in base.application.EntityContactInformationsGet(Id)) { dataValue = dataValue + "|" + currentContactInformation.Id.ToString(); } #endregion break; default: dataValue = "!Error"; break; } return(dataValue); }