示例#1
0
        public void AddNewNapoi()
        {
            string Excerpt;
            string Country_made;
            int    Cost;
            int    Volume;

            Console.Write("\nEnter a excerpt of napoi: ");
            Excerpt = Console.ReadLine();
            Console.Write("Enter a country made of napoi: ");
            Country_made = Console.ReadLine();
            Console.Write("Enter a napois price: ");
            while (!int.TryParse(Console.ReadLine(), out Cost) || Cost <= 0)
            {
                Console.Write("Enter a correct speed value, please: ");
            }
            Console.Write("Enter a vodka's volume of bottle: ");
            while (!int.TryParse(Console.ReadLine(), out Volume) || Volume > 10 || Volume < 0)
            {
                Console.Write("Enter a correct volume, please: ");
            }
            Napoi newNapoi = new Napoi(Excerpt, Country_made, Cost, Volume);

            nap.Add(newNapoi);
        }
示例#2
0
 public void DisplayInfoAboutNapoi(Napoi Napoi)
 {
     Console.WriteLine("\nExcerpt  : {0}\nCountry_made  : {1}\nCost  : {2}\nVolume  : {3}", Napoi.Excerpt, Napoi.Country_made, Napoi.Cost, Napoi.Volume);
 }