コード例 #1
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
 private void displayInfoEntity(dynamic one, string header)
 {
     if (header != "")
     {
         HelperIO.welcomeMessage(header);
     }
     System.Console.WriteLine(one.ToString());
 }
コード例 #2
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
        public void addCity()
        {
            displayInfoEntities(cityList, "Список міст");
            cityList.Add(new City());

            cityList.Last().Name = HelperIO.stringInput("Введіть назву міста");
            cityMenu();
        }
コード例 #3
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
        public void addCrew()
        {
            displayInfoEntities(crewList, "Список екіпажів");
            crewList.Add(new Crew());

            crewList.Last().CarNumber  = HelperIO.stringInput("Введіть номер авто");
            crewList.Last().DriverName = HelperIO.stringInput("Введіть ПІБ водія");
            addRoute(crewList.Last().Id);
            menu();
        }
コード例 #4
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
        private void addRoute(int routeId)
        {
            displayInfoRoutes(routeId, "Список маршрутів");

            RouteList.Add(new Route(routeId));

            displayInfoEntities(cityList, "Список міст");
            RouteList.Last().CityFrom = cityList[HelperIO.intAbsInput("Введіть номер міста початку маршруту", cityList.Count)];
            displayInfoEntities(cityList, "Список міст");
            RouteList.Last().CityTo      = cityList[HelperIO.intAbsInput("Введіть номер міста кінця маршруту", cityList.Count)];
            RouteList.Last().ArrivalTime = HelperIO.intAbsInput("Введіть тривалість поїздки, хв");
        }
コード例 #5
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
        private void displayInfoEntities(dynamic one, string header)
        {
            if (one.Count > 0)
            {
                HelperIO.welcomeMessage(header);
            }
            int i = 0;

            foreach (Entity element in one)
            {
                System.Console.WriteLine((i++) + " -> " + element.ToString());
            }
        }
コード例 #6
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
 private void displayInfoRoutes(int routeId, string header)
 {
     if (RouteList.Count > 0)
     {
         HelperIO.welcomeMessage(header);
         foreach (Route element in RouteList)
         {
             if (element.RouteId == routeId)
             {
                 System.Console.WriteLine(element.ToString());
             }
         }
     }
 }
コード例 #7
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
        private string display(string header, IDictionary <string, string> menu, IDictionary <string, string> methtods, string active)
        {
            HelperIO.welcomeMessage(header);
            Console.WriteLine("Будь ласка виберіть один з пунктів:");
            foreach (KeyValuePair <string, string> item in menu)
            {
                Console.WriteLine("{0} - {1}", item.Key, item.Value);
            }
            string choice = Console.ReadLine();

            if (methtods.ContainsKey(choice))
            {
                Console.Clear();
                string value;
                methtods.TryGetValue(choice, out value);
                return(value);
            }
            else
            {
                HelperIO.displayError();
                return(active);
            }
        }
コード例 #8
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
 public void display()
 {
     displayInfoEntities(crewList, "Список екіпажів");
     HelperIO.successMessage("-------------------------------------------------------------------------------");
     menu();
 }
コード例 #9
0
ファイル: Worker.cs プロジェクト: web-ruslan/Modern_laba3
 public void addRoute()
 {
     displayInfoEntities(crewList, "Список екіпажів");
     addRoute(crewList[HelperIO.intAbsInput("Введіть номер екіпажу", crewList.Count)].Id);
     routeMenu();
 }