protected void Page_Load(object sender, EventArgs e) { int offerId; bool isFound = false; if (int.TryParse(Request.QueryString["oid"], out offerId)) { var offer = service.FindOffer(offerId); if (offer != null) { isFound = true; if (IsOfferReserved(offerId)) { pnlConfirm.Visible = false; Message.Text = "Offer is already reserved."; } else { pnlConfirm.Visible = true; OfferId.Value = offerId.ToString(); Message.Text = String.Format("Do you really want to reserve the offer: Country: '{0}'; Departure Date: {1} ", offer.tPanstwa.NazwaPanstwa, offer.DataWyjazdu); } } } if (!isFound) { Message.Text = "Offer is not found."; } }
// GET: Offers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tOferta tOferta = service.FindOffer(id.Value); if (tOferta == null) { return(HttpNotFound()); } ViewBag.IsReserved = IsOfferReserved(id.Value); ViewBag.AttractionReserved = new AttractionReserved(service.GetAttractionIdToReservedMap(AuthorizeUtil.GetUserId(service, User))); return(View(tOferta)); }