예제 #1
0
        /// <summary>
        /// Checks if the given id is unique
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool uniqueId(string id)
        {
            int index = 0;

            // Loop to check that the given Id is unique
            while (estateManager.CheckIndex(index))
            {
                Estate e = estateManager.GetAt(index);
                if (e.Id == id)
                {
                    MessageBox.Show($"The id: {id} is not unique, please chooose anonther Id. \n" +
                                    $" To see the Id´s int he list, browse the Delete tab.");
                    return(false);
                }

                ++index;
            }

            return(true);
        }