private void Start() { template = GameObject.FindGameObjectWithTag("RoomsList").GetComponent <RoomTypeList>(); // Allows us to call a method with a delay. Collision would not be detected properly if spawned at the same time. Invoke("SpawnRooms", 0.1f); }
private void SearchAndBind() { HotelMerchandise m_SaleMerchandise = (HotelMerchandise)this.OnSearch(); if (m_SaleMerchandise.Items.Count > 0) { string hotelid = this.Request["HotelID"]; string hotelName = this.Request["HotelName"]; string strCheckin = this.Request["CheckIn"]; string strGTACityCode = this.Request["GTACITYCODE"]; if (this.Request["edit"] == "y") DeleteBeingChangedHotelOrderItem(hotelName, strCheckin); MVHotel currentHotel = GetBeingChangedHotel(m_SaleMerchandise, hotelid, hotelName, strCheckin, strGTACityCode); RoomTypeList cancel = new RoomTypeList(); RoomTypeList canceldelete = new RoomTypeList(); if (currentHotel != null && currentHotel.Profile.GetParam("DATASOURCE").ToString().Trim().ToUpper() == "GTA") { Terms.Sales.Business.CancellationPolicy Policy = new CancellationPolicy(); cancel = Policy.GetIsNoHotelCancellation(currentHotel, true, out canceldelete); } if (currentHotel.Items.Count > 0) { HTLSelectRoomTypeControl1.RoomCancel = cancel; HTLSelectRoomTypeControl1.RoomDelete = canceldelete; HTLSelectRoomTypeControl1.HotelMaterial = currentHotel; } else { this.Response.Redirect("SearchResultForm.aspx" + "?ConditionID=" + Request.Params["ConditionID"]); } } else { this.Response.Redirect("~/Index.aspx"); } }
public static MailInfo CreateMail(this WebBooking bookingInfo, string htmlTemplate, HouseList houseList, RoomTypeList roomTypeList) { var result = new MailInfo { Subject = "New Customer Reservation", IsBodyHtml = true, To = new[] { ConfigManager.ReservationEmail } }; var house = houseList?.Houses.SingleOrDefault(h => h.Id.Equals(bookingInfo.HouseId)); var roomType = roomTypeList?.RoomTypes.SingleOrDefault(r => r.Id.Equals(bookingInfo.RoomTypeId)); var body = htmlTemplate.Replace("{{fullName}}", bookingInfo.Fullname); body = body.Replace("{{gender}}", bookingInfo.IsMale ? "Male" : "Female"); body = body.Replace("{{email}}", bookingInfo.Email); body = body.Replace("{{phone}}", bookingInfo.Phone); body = body.Replace("{{houseName}}", house == null ? "[Not Specified]" : house.Name); body = body.Replace("{{roomType}}", roomType == null ? "[Not Specified]" :roomType.Name + " - " + roomType.Price + "$"); body = body.Replace("{{dateRange}}", bookingInfo.From.ToString("d") + " - " + bookingInfo.To.ToString("d")); body = body.Replace("{{numPersons}}", bookingInfo.NumberOfPersons.ToString()); body = body.Replace("{{numRooms}}", bookingInfo.NumberOfRooms.ToString()); result.Body = body; return(result); }