示例#1
0
        public void Run()
        {
            Console.Clear();
            Console.WriteLine("Give a number of Estate :");
            try
            {
                int num    = int.Parse(Console.ReadLine());
                var estate = _iDatabase.GetEstate(num);
                Console.WriteLine("\nEstate details\n=====================");
                EstatePrinter.Print(estate);
            }

            catch (FormatException ex)
            {
                Console.WriteLine("Incorrect number. " + ex.Message);
                Program.LogException(ex);
            }

            catch (InvalidOperationException ex)
            {
                Console.WriteLine("Number does not exist in database. " + ex.Message);
                Program.LogException(ex);
            }

            catch (OverflowException ex)
            {
                Console.WriteLine("Two large input value. " + ex.Message);
                Program.LogException(ex);
            }
        }
示例#2
0
        public void Run()
        {
            Console.Clear();
            var estates = _iDatabase.GetAllEstates();

            Console.WriteLine("List of estates: \n====================");
            EstatePrinter.PrintList(estates);
        }
示例#3
0
 private static void ShowAllEstates()
 {
     if (_database.IsEmpty())
     {
         Console.WriteLine("Brak jakiejkolwiek nieruchomości!");
         Console.ReadLine();
     }
     else
     {
         EstatePrinter.PrintEstates(_database.GetEstates());
     }
 }
示例#4
0
 private static void ShowEstate()
 {
     if (!IsEstateInDatabase(out int id))
     {
         Console.WriteLine("Brak nieruchomości o podanym numerze!");
         Console.ReadLine();
     }
     else
     {
         EstatePrinter.PrintEstate(_database.GetEstate(id));
     }
 }