Beispiel #1
0
        /// <summary>
        /// Log the person and show them on the screen.
        /// If any of firstName, lastName or idCode are null, logs stuff to the Debug stream and returns early.
        /// </summary>
        /// <param name="firstName">The person's first name</param>
        /// <param name="lastName">The person's last name</param>
        /// <param name="idCode">The person's ID code (numeric string)</param>
        private void logPerson(string firstName, string lastName, string idCode)
        {
            if (firstName == null || lastName == null || idCode == null)
            {
                Debug.Print("!! logPerson has firstName or lastName or idCode null");
                Debug.Print("firstName={0} lastName={1} idCode={2}", firstName, lastName, idCode);
                return;
            }

            incrementScannedCount();

            Person p     = personnelReader.ReadPersonalData(idCode);
            string kutse = p?.data["Kutse"];

            if (kutse == null)
            {
                Debug.Print("Inimese kutset ei saanud logida, puudub Kutse: {0}", idCode);
            }
            writer.log(firstName, lastName, idCode, kutse ?? "-1");
            ShowPerson(firstName + " " + lastName, pmReader.GetPersonMessage(idCode));
        }