示例#1
0
        private string serialText; //aid serial text

        #endregion Fields

        #region Constructors

        /// <summary>
        /// constructor
        /// </summary>
        public Aid()
        {
            this.serialText = "";
            this.modelText = "";
            this.model = null;
            this.ear = AidEar.Unknown;
        }
示例#2
0
 /// <summary>
 /// Attempts to guess what ear the aid fits in using the serialText
 /// </summary>
 private void GuessEar()
 {
     //only guess with 10 digit serials
     if (this.serialText.Length == 10)
     {
         //check all chars are digits
         bool allDigits = true;
         foreach (char c in this.serialText)
         {
             if (! Char.IsDigit(c))
                 allDigits = false;
         }
         if (allDigits)
         {
             if (long.Parse(this.serialText) % 2 == 0)
             {
                 //even number is right
                 this.ear = AidEar.Right;
             }
             else
             {
                 //odd number is left
                 this.ear = AidEar.Left;
             }
         }
         else
         {
             this.ear = AidEar.Unknown;
         }
     }
     else
     {
         this.ear = AidEar.Unknown;
     }
 }