コード例 #1
0
 /// <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);
 }
コード例 #2
0
 public Phone(int cc, int ac, int num, ContactNumberType numberType)
 {
     CC                = cc;
     AC                = ac;
     Number            = num;
     ContactNumberType = numberType;
 }
コード例 #3
0
        // 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;
        }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
        // 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);
        }
コード例 #6
0
        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;
        }
コード例 #7
0
 public void setType(int aType)
 {
     this.type = this.indexToType(aType);
 }
コード例 #8
0
 // Type
 public void setType(ContactNumberType aType)
 {
     this.type = aType;
 }
コード例 #9
0
 public IndividualContactNumber(Individual individual, string contactNumber, ContactNumberType contactNumberType, Guid id = new Guid()) : base(id)
 {
     Individual = individual;
     ContactNumber = contactNumber;
     ContactNumberType = contactNumberType;
 }