Пример #1
0
        /// <summary>
        /// this button shows all the rooms the user can reserve
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonCheckRooms_Click(object sender, EventArgs e)
        {
            DateTime ArrivalDate = DateTime.Parse(TextBoxArrivalDate.Text);
            DateTime levingDate  = DateTime.Parse(TextBoxLevingDate.Text);

            List <Room> rooms = HotelManager.GetRooms(yesOrNo, usrServices, ArrivalDate, levingDate);

            GridViewRoomNo.DataSource = rooms;
            GridViewRoomNo.DataBind();
        }
Пример #2
0
        protected void ButtonSaveGuest_Click(object sender, EventArgs e)
        {
            string fisteName = TextBoxFistName.Text;
            string lastName  = TextBoxLastName.Text;
            string adderss   = "JVej no. 8";
            string mail      = TextBoxMail.Text;
            int    telefonNo = Convert.ToInt32(TextBoxPhoneNo.Text);
            int    zipCode   = 4800;

            HotelManager.SetGuests(fisteName, lastName, adderss, mail, telefonNo, zipCode);

            List <Guests> guests = HotelManager.GetGuestsID();

            foreach (Guests item in guests)
            {
                TextBoxGuestsId.Text = item.GuestsID.ToString();
            }
        }
        private int CalculateAmount(int roomNumber)
        {
            HotelManager.GetRoomPrice(roomNumber);

            int servicesPrice = 0;

            foreach (TotalAmount item in HotelManager.GetServicePrice(roomNumber))
            {
                servicesPrice = servicesPrice + item.ServicePrice;
            }

            int roomPrice = 0;

            foreach (TotalAmount item in HotelManager.GetRoomPrice(roomNumber))
            {
                roomPrice = item.RoomPrice;
            }

            return(roomPrice + servicesPrice);
        }