Exemplo n.º 1
0
            public Word()
            {
                Console.Write("Word: ");
                string word = Convert.ToString(Console.ReadLine());

                Console.Write("Meaning: ");
                string meaning = Convert.ToString(Console.ReadLine());

                Console.Write("Category: ");
                string category = Convert.ToString(Console.ReadLine());

                if (!ConsoleRepresentation.IsTrueInput(category, 30) || !ConsoleRepresentation.IsTrueInput(meaning, 100) || !ConsoleRepresentation.IsTrueInput(word, 30))
                {
                    throw new Exception();
                }
                this.word     = word;
                this.meaning  = meaning;
                this.category = category;
            }
Exemplo n.º 2
0
        private static void RemoveWord(DateBase Glossary)
        {
            Console.Clear();
            Console.WriteLine("***Word search***");
            Console.Write("\n\nWord: ");
            string wordRM = Convert.ToString(Console.ReadLine());

            if (!ConsoleRepresentation.IsTrueInput(wordRM, 30))
            {
                Console.WriteLine("Wrong input");
                ConsoleRepresentation.BackToMenuMessage();
                return;
            }
            Console.WriteLine("Press 1 to delete it?");
            if (ConsoleRepresentation.ReadChoise(0, 1) == 1)
            {
                //removes word and information about it marking from glossary
                Glossary.stroredProcedures.DeleteWord(wordRM);
            }
        }