Пример #1
0
 public BaseVoucher(Country country, HotelClass hotelClass, Food food, double price)
 {
     Country    = country;
     HotelClass = hotelClass;
     Food       = food;
     Price      = price;
 }
        public UserControlHotelUnt(HotelClass hotelUnt)
        {
            InitializeComponent();

            lblNomeHotel.Text      = hotelUnt.Nome;
            lblEndereco.Text       = hotelUnt.Endereco;
            pbUhotel.ImageLocation = "C:\\Users\\danie\\source\\repos\\Session1Daniel\\Session1Daniel\\Resources\\" + hotelUnt.Imagem;
        }
Пример #3
0
        private void adicionaHotel(HotelClass hotel, int id, int y)
        {
            UserControlHotelUnt userControlHotelUnt = new UserControlHotelUnt(hotel);

            userControlHotelUnt.Location = new System.Drawing.Point(0, y);
            userControlHotelUnt.Name     = "userControlHotelUnt" + id;
            userControlHotelUnt.TabIndex = 14;

            pnlPrincipal.Controls.Add(userControlHotelUnt);
        }
Пример #4
0
        private HotelClass buscaHotelById(int id)
        {
            HotelClass hotel = new HotelClass();

            HotelTableAdapter hotelTableAdapter = new HotelTableAdapter();

            dbSession1DanielDataSet.HotelDataTable dados = hotelTableAdapter.GetHotelById(id);

            foreach (DataRow item in dados)
            {
                hotel.Id       = int.Parse(item["HOTCODIGO"].ToString());
                hotel.Nome     = item["HOTNOME"].ToString();
                hotel.Endereco = item["HOTENDERECO"].ToString();
                hotel.Imagem   = item["HOTFOTO"].ToString();
            }

            return(hotel);
        }
Пример #5
0
        private void atualizaHoteisIni()
        {
            List <int> listHotelDisponivel = new List <int>();

            listHotelDisponivel = getHoteisDisponiveis();
            int y = 0;

            foreach (int id in listHotelDisponivel)
            {
                HotelClass hotel = new HotelClass();

                hotel = buscaHotelById(id);

                adicionaHotel(hotel, id, y);

                y = y + 200;
            }
        }
Пример #6
0
 public RestVoucher(Country country, HotelClass hotelClass, Food food, double price) : base(country, hotelClass, food, price)
 {
     TypeOfVoucher = TypeOfVoucher.rest;
 }
Пример #7
0
 public ExcursionVoucher(Country country, HotelClass hotelClass, Food food, double price) : base(country, hotelClass, food, price)
 {
     TypeOfVoucher = TypeOfVoucher.excursions;
 }
Пример #8
0
 public TreatmentVoucher(Country country, HotelClass hotelClass, Food food, double price) : base(country, hotelClass, food, price)
 {
     TypeOfVoucher = TypeOfVoucher.treatment;
 }
Пример #9
0
 public CruiseVoucher(Country country, HotelClass hotelClass, Food food, double price) : base(country, hotelClass, food, price)
 {
     TypeOfVoucher = TypeOfVoucher.cruise;
 }
Пример #10
0
        static void Main(string[] args)
        {
            Console.WriteLine("We can offer you such vouchers:\n");

            var vouchers = new TravelAgency();

            vouchers.AddVoucher(new CruiseVoucher(Country.Australia, HotelClass.A, Food.allInclusive, 5000));
            vouchers.AddVoucher(new ExcursionVoucher(Country.Turkish, HotelClass.C, Food.breakfastOnly, 1000));
            vouchers.AddVoucher(new RestVoucher(Country.Albania, HotelClass.D, Food.breakfastOnly, 800));
            vouchers.AddVoucher(new ShoppingVoucher(Country.Italy, HotelClass.A, Food.noMeals, 4000));
            vouchers.AddVoucher(new TreatmentVoucher(Country.Egypt, HotelClass.B, Food.breakfastOnly, 1600));
            vouchers.AddVoucher(new CruiseVoucher(Country.Egypt, HotelClass.C, Food.noMeals, 2000));
            vouchers.AddVoucher(new ExcursionVoucher(Country.Turkish, HotelClass.A, Food.allInclusive, 11000));
            vouchers.AddVoucher(new RestVoucher(Country.Turkish, HotelClass.D, Food.breakfastOnly, 800));
            vouchers.AddVoucher(new ShoppingVoucher(Country.Italy, HotelClass.A, Food.noMeals, 4000));
            vouchers.AddVoucher(new TreatmentVoucher(Country.Egypt, HotelClass.B, Food.breakfastOnly, 1100));
            vouchers.AddVoucher(new CruiseVoucher(Country.Australia, HotelClass.B, Food.allInclusive, 5000));
            vouchers.AddVoucher(new ExcursionVoucher(Country.Turkish, HotelClass.D, Food.noMeals, 700));
            vouchers.AddVoucher(new RestVoucher(Country.Albania, HotelClass.D, Food.breakfastOnly, 1800));
            vouchers.AddVoucher(new ShoppingVoucher(Country.Italy, HotelClass.A, Food.noMeals, 3300));
            vouchers.AddVoucher(new TreatmentVoucher(Country.Egypt, HotelClass.B, Food.breakfastOnly, 2500));


            BaseVoucher.PrintInfo(vouchers.Agency);

            Console.WriteLine("\nPlease, enter the criteria by which we can choose a voucher\n");
            Console.WriteLine("Select type of voucher:\npress 1 - rest\npress 2 - excursion\npress 3 - treatment\npress 4 - shopping\npress 5 - cruise");


            int           selectVoucher = int.Parse(Console.ReadLine());
            TypeOfVoucher typeOfVoucher = (TypeOfVoucher)selectVoucher;

            Console.Write($"You selected category: " + typeOfVoucher.ToString() + "\n");


            List <BaseVoucher> foundVouchers = vouchers.SearchVoucher(vouchers.Agency, selectVoucher);

            BaseVoucher.PrintInfo(foundVouchers);

            Console.WriteLine("\nSelect country:");
            Console.WriteLine("Select type of voucher:\npress 1 - Australia\npress 2 - Turkish\npress 3 - Albania\npress 4 - Italy\npress 5 - Egypt");

            int     selectCountry = int.Parse(Console.ReadLine());
            Country country       = (Country)selectCountry;

            Console.Write($"You selected category: " + country.ToString() + "\n");
            foundVouchers = vouchers.SearchCountry(foundVouchers, selectCountry);
            BaseVoucher.PrintInfo(foundVouchers);

            Console.WriteLine("\nSelect hotel class:");
            Console.WriteLine("Select type of voucher:\npress 1 - A\npress 2 - B\npress 3 - C\npress 4 - D");

            int        selectHotelClass = int.Parse(Console.ReadLine());
            HotelClass hotelClass       = (HotelClass)selectHotelClass;

            Console.Write($"You selected category: " + hotelClass.ToString() + "\n");
            foundVouchers = vouchers.SearchHotel(foundVouchers, selectHotelClass);
            BaseVoucher.PrintInfo(foundVouchers);

            Console.WriteLine("\nSelect price of voucher:");
            int price = int.Parse(Console.ReadLine());

            for (int i = 0; i < foundVouchers.Count; i++)
            {
                if (price >= foundVouchers[i].Price)
                {
                    Console.WriteLine(foundVouchers[i].ToString());
                }
            }

            Console.ReadKey();
        }
Пример #11
0
 public ShoppingVoucher(Country country, HotelClass hotelClass, Food food, double price) : base(country, hotelClass, food, price)
 {
     TypeOfVoucher = TypeOfVoucher.shopping;
 }