/// <summary> /// Add an identity to this customer /// </summary> /// <param name="vo"></param> public void addIdentity(IdentificationVO vo) { if (vo == null || this.identities == null || this.identities.Contains(vo)) { return; } int index = 0; string code = vo.IdType; if (code == CustomerIdTypes.DRIVERLIC.ToString()) { index = (int)CustomerIdTypes.DRIVERLIC; } if (code == CustomerIdTypes.SI.ToString()) { index = (int)CustomerIdTypes.SI; } if (code == CustomerIdTypes.RI.ToString()) { index = (int)CustomerIdTypes.RI; } if (code == CustomerIdTypes.MC.ToString()) { index = (int)CustomerIdTypes.MC; } if (code == CustomerIdTypes.MI.ToString()) { index = (int)CustomerIdTypes.MI; } if (code == CustomerIdTypes.PASSPORT.ToString()) { index = (int)CustomerIdTypes.PASSPORT; } if (code == CustomerIdTypes.GI.ToString()) { index = (int)CustomerIdTypes.GI; } if (code == CustomerIdTypes.II.ToString()) { index = (int)CustomerIdTypes.II; } if (code == CustomerIdTypes.CW.ToString()) { index = (int)CustomerIdTypes.CW; } //if (code == CustomerIdTypes.FFL.ToString()) // index = (int)CustomerIdTypes.FFL; if (code == CustomerIdTypes.OT.ToString()) { index = (int)CustomerIdTypes.OT; } vo.SortOrder = index; //Madhu 12/07/2010 fix for bugzilla defect 10 //foreach (IdentificationVO id in this.identities) // id.IsLatest = false; this.identities.Add(vo); }
/// <summary> /// Sets the IsLatest to true for the id object passed in /// </summary> /// <param name="idObj"></param> public void updateLatestIdentity(IdentificationVO idObj) { if (idObj != null) { IdentificationVO custId = getIdentity(idObj.IdType, idObj.IdValue, idObj.IdIssuerCode, (idObj.IdExpiryData).FormatDate()); if (custId != null) { custId.IsLatest = true; } } }
public bool IsSameIDDesc(IdentificationVO compareToObj) { if (this.DatedIdentDesc == compareToObj.DatedIdentDesc) { return(true); } else { return(false); } }
public bool IsSameIDType(IdentificationVO compareToObj) { if (this.IdType == compareToObj.IdType) { return(true); } else { return(false); } }
/// <summary> /// Returns the ID objects of the customer that matches the type and issuer code passed in /// </summary> /// <param name="strIdType"></param> /// <param name="strIdIssuer"></param> /// <returns></returns> public IdentificationVO getIdByTypeandIssuer(string strIdType, string strIdIssuer) { if (strIdType.Trim().Length == 0 || strIdIssuer.Trim().Length == 0) { return(null); } IdentificationVO custId = this.identities.Find(delegate(IdentificationVO idObj) { return(idObj.IdType == strIdType && idObj.IdIssuerCode == strIdIssuer); }); return(custId); }
/// <summary> /// For the id type code, number, issuer and expiry date passed in /// check if any such identification exists for the current customer /// </summary> /// <param name="idTypeCode"></param> /// <param name="idNumber"></param> /// <param name="idIssuer"></param> /// <param name="idExpiryDate"></param> /// <returns></returns> public IdentificationVO getIdentity(string idTypeCode, string idNumber, string idIssuer, string idExpiryDate) { if (idTypeCode.Trim().Length == 0 || this.identities == null) { return(null); } IdentificationVO custId = this.identities.Find(delegate(IdentificationVO idObj) { return(idObj.IdType == idTypeCode && idObj.IdValue == idNumber && idObj.IdIssuerCode == idIssuer && (idObj.IdExpiryData).FormatDate() == idExpiryDate); }); return(custId); }
/// <summary> /// For the IDtype code, number and issuer name passed in check /// if any such identification exists for the current customer /// </summary> /// <param name="idTypeCode"></param> /// <param name="idNumber"></param> /// <param name="idIssuer"></param> /// <returns></returns> public IdentificationVO getIdentity(string idTypeCode, string idNumber, string idIssuer) { if (this.NumberIdentities == 0 || idTypeCode.Trim().Length == 0 || this.identities == null) { return(null); } IdentificationVO custId = this.identities.Find(delegate(IdentificationVO idObj) { return(idObj.IdType == idTypeCode && idObj.IdValue == idNumber && idObj.IdIssuer == idIssuer); }); return(custId); }
/// <summary> /// Returns the first identity object /// Ideally this has to be the one whose isLatest=true but /// that is not being passed back from the stored procedure so the customer pulled /// back from the db may not have this set but for a new customer or if its a new id /// entered for an existing customer this value is set in code /// </summary> /// <returns></returns> public IdentificationVO getFirstIdentity() { if (this.identities != null && this.identities.Count > 0) { IdentificationVO idObj = this.identities.Find( identObj => identObj.IsLatest); if (idObj == null) { return(this.identities[0]); } return(idObj); } return(null); }
public IdentificationVO(IdentificationVO ivo) { if (ivo != null) { this.IdIssuer = ivo.IdIssuer; this.IdIssuerCode = ivo.IdIssuerCode; this.IdType = ivo.IdType; this.IdValue = ivo.IdValue; this.IDDesc = ivo.IDDesc; this.DatedIdentDesc = ivo.DatedIdentDesc; this.IdExpiryData = ivo.IdExpiryData; this.IdentId = ivo.IdentId; this.IsLatest = ivo.IsLatest; this.IdIssueDate = ivo.IdIssueDate; this.CreationDate = ivo.CreationDate; } else { this.initialize(); } }