Example #1
0
        static void Main(string[] args)
        {
            Doctor d1 = new Doctor();

            d1.ShowDoctor("mani jyothi", 2000, "neuro");
            d1.DisplayDoctor();
            Console.WriteLine("------------------------------------");
            doctor1 d2 = new doctor1();

            d2.ShowDoc1(2500, "Aishwarya", 8364734641);
            d2.displaydoc1();
            Console.WriteLine("------------------------------------");
            Car c1 = new Car();

            c1.Showcar(2426299, "harrier", 2020);
            c1.DisplayCar();
            Console.WriteLine("------------------------------------");
            Car c2 = new Car();

            c2.Showcar(1226299, "altroz", 2019);
            c2.DisplayCar();
            Console.WriteLine("------------------------------------");
            Employee1 e1 = new Employee1();

            e1.ShowEmpDetails(17535, 50000, "Trainer");
            e1.DisplayEmpDetails();
            Console.WriteLine("------------------------------------");
            Employee1 e2 = new Employee1();

            e2.ShowEmpDetails(83635, 15000, "Trainee");
            e2.DisplayEmpDetails();
            Console.WriteLine("------------------------------------");
            customer1 cus1 = new customer1();

            cus1.ShowCustomerInfo("Maniteja", "Idea", 399);
            cus1.DisplayCustomerInfo();
            Console.WriteLine("------------------------------------");
            customer1 cus2 = new customer1();

            cus2.ShowCustomerInfo("Balu", "Airtel", 599);
            cus2.DisplayCustomerInfo();
            Console.WriteLine("------------------------------------");
            laptop1 l1 = new laptop1();

            l1.showlaptopdetails(8, 45000, "lenovo");
            l1.DisplaylapDetails();
            Console.WriteLine("------------------------------------");
            laptop1 l2 = new laptop1();

            l2.showlaptopdetails(4, 35500, "dell");
            l2.DisplaylapDetails();
        }
Example #2
0
        public static void DoctorsList()
        {
            int pageNumber = 0;

            doctorChoosing = true;
            while (doctorChoosing)
            {
                int pages       = (int)Convert.ToDecimal(Math.Ceiling((decimal)Mock._doctors.Count / 3));
                int doctorIndex = pageNumber * 3;

                Console.Clear();
                MenuManager.DisplayLogoAndMenu("doctorsMenu", "pay", Mock._doctors.Count);

                Console.WriteLine("  Lista lekarzy:                     STRONA: " + (pageNumber + 1) + "/" + pages);
                Mock._doctors.Sort((x, y) => x.Id.CompareTo(y.Id));

                if (Mock._doctors.Count > 0)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        if (doctorIndex + i < Mock._doctors.Count)
                        {
                            Doctor.DisplayDoctor(doctorIndex + i);
                        }
                    }
                }
                else
                {
                    Console.WriteLine("  Brak lekarzy do wyświetlenia!");
                }

                Console.Write("\n  Wybierz lekarza: ");
                wpis = Console.ReadLine();

                bool isNumeric = int.TryParse(wpis, out int number);
                if (isNumeric && Enumerable.Range(1, Mock._doctors.Count).Contains(number))
                {
                    if (Mock._doctors[number - 1].VisitsTaken < Mock._doctors[number - 1].VisitsAvailable)
                    {
                        MenuManager.ConfirmationMenu(number - 1, "pay");
                        Console.Write("  Odpowiedź: ");
                        wpis = Console.ReadLine();

                        switch (wpis)
                        {
                        case "1":
                            if (Mock.loggedUser.Wallet >= Mock._doctors[number - 1].Price)
                            {
                                ChangeAmountOfMoney(Mock.loggedUser.Login, -Mock._doctors[number - 1].Price);
                                Mock._doctors[number - 1].VisitsTaken++;
                                ModifyUserVisits(Mock.loggedUser.Login, Mock._doctors[number - 1].Id, 1);
                            }
                            else
                            {
                                MenuManager.InfoAlert("  INFO: Nie stać Cię na tę wizytę!\n");
                            }
                            break;

                        case "2":
                            MenuManager.InfoAlert("  INFO: Transakcja anulowana na życzenie użytkownika!\n");
                            break;

                        default:
                            MenuManager.InfoAlert("  INFO: Komenda nieznana, na wszelki wypadek transakcja anulowana!\n");
                            break;
                        }
                    }
                    else
                    {
                        MenuManager.InfoAlert("  INFO: Ten lekarz nie ma więcej dostępnych wizyt!\n");
                    }
                }
                else if (wpis == "prev")
                {
                    if (pageNumber > 0)
                    {
                        pageNumber--;
                        MenuManager.InfoAlert("  INFO: Wybrano poprzednią stronę!\n");
                    }
                    else
                    {
                        MenuManager.InfoAlert("  INFO: To jest pierwsza strona, nie da się cofnąć!\n");
                    }
                }
                else if (wpis == "next")
                {
                    if (pageNumber < pages - 1)
                    {
                        pageNumber++;
                        MenuManager.InfoAlert("  INFO: Wybrano następną stronę!\n");
                    }
                    else
                    {
                        MenuManager.InfoAlert("  INFO: To jest ostatnia strona, nie da się iść dalej!\n");
                    }
                }
                else if (wpis == "back")
                {
                    MenuManager.InfoAlert("  INFO: Wybrano powrót do poprzedniego ekranu.\n");
                    doctorChoosing = false;
                }
                else if (!Enumerable.Range(1, Mock._doctors.Count).Contains(number))
                {
                    MenuManager.InfoAlert("  INFO: Podanego lekarza nie ma na liście!\n");
                }
            }
        }