/// <summary> /// Construct Object with Extention, Code, Number and Type (Defined). /// </summary> /// <param name="anExt"></param> /// <param name="aCode"></param> /// <param name="aNumber"></param> /// <param name="aType"></param> public ContactNumber(string anExt, string aCode, string aNumber, ContactNumberType aType) { this.extention = anExt; this.code = aCode; this.number = aNumber; this.setType(aType); }
public Phone(int cc, int ac, int num, ContactNumberType numberType) { CC = cc; AC = ac; Number = num; ContactNumberType = numberType; }
// Class Constructors /// <summary> /// Construct Object with all atrributes null /// </summary> public ContactNumber() { this.extention = null; this.code = null; this.number = null; this.type = ContactNumberType.UNKNOWN; }
/// <summary> /// Construct Object with Code and Number only, Extention null and Type unknown /// </summary> /// <param name="aCode"></param> /// <param name="aNumber"></param> public ContactNumber(string aCode, string aNumber) { this.extention = null; this.code = aCode; this.number = aNumber; this.type = ContactNumberType.UNKNOWN; }
// Class Specific Utility /// <summary> /// Attempt to Convert Integer Index value into a defined ContactNumberType /// </summary> /// <param name="anInt">Integer Index value of ContactNumberType</param> /// <returns>A defined ContactNumberType if exists else Type.UNKNOWN</returns> private ContactNumberType indexToType(int anInt) { try { ContactNumberType aType = (ContactNumberType)anInt; return(aType); } catch (Exception e) { // Handle - Enum type of Index given does not exist } return(ContactNumberType.UNKNOWN); }
public virtual void SetContactNumber(string number, ContactNumberType type) { if (string.IsNullOrEmpty(number)) return; ContactNumbers = ContactNumbers ?? new HashSet<IndividualContactNumber>(); var individualContactNumber = ContactNumbers.FirstOrDefault(x => x.Individual != null && (x.Individual.Id == Id && (x.ContactNumber + "").Trim().ToLower() == (number + "").Trim().ToLower())); if (individualContactNumber == null) { individualContactNumber = new IndividualContactNumber(this, number, type); ContactNumbers.Add(individualContactNumber); } individualContactNumber.ContactNumber = number; }
public void setType(int aType) { this.type = this.indexToType(aType); }
// Type public void setType(ContactNumberType aType) { this.type = aType; }
public IndividualContactNumber(Individual individual, string contactNumber, ContactNumberType contactNumberType, Guid id = new Guid()) : base(id) { Individual = individual; ContactNumber = contactNumber; ContactNumberType = contactNumberType; }