[HttpPost] //run this method when its posting back information
        public ActionResult Index(FreeRooms FreeRoom, FreeRooms model)
        {

            if (!ModelState.IsValid)
            {
                ////mvc automatically checkes the state of any values coming in
                //                // return the view to correct validation errors
                ViewBag.error = " Error";
                FreeRoom.BookingFrom = DateTime.Today.Date;
                FreeRoom.BookingTo = DateTime.Today.Date.AddDays(1).Date;
                FreeRoom.GuestNumbers = "1";

                return View(FreeRoom);
            }
            //sets the values if there are no errors

          //  FreeRoom.BookingFrom = model.BookingFrom;
          //  FreeRoom.BookingTo = model.BookingTo2;
         //   FreeRoom.GuestNumbers = model.GuestNumbers;
                FreeRoom.Name = model.Name;
                FreeRoom.Email = model.Email;
                //FreeRoom.RoomNum = model.RoomNum;
                //FreeRoom.CostOfRoom = model.CostOfRoom;
             
               FreeRoom.Add();
               FreeRoom.RoomDetails();
               FreeRoom.combinelist();
                ViewBag.error = " Working";
         
            
            if (!string.IsNullOrWhiteSpace(FreeRoom.Name) && !string.IsNullOrWhiteSpace(FreeRoom.Email) && !string.IsNullOrWhiteSpace(model.RoomNumandCost)) // checks if there is text in name & email and if a room number is selected fore sending data
            {
                FreeRoom.NewBooking(); //need to add the booking before the guest
                FreeRoom.NewGuest();

            }

            return View(FreeRoom);
        }