コード例 #1
0
        public void ReserveOffer()
        {
            service.ClearReservationTables();
            service.Save();

            bool actual = service.IsOfferReserved(1, 1, 1);

            Assert.IsFalse(actual);

            // Reserve attraction
            service.ReserveOffer(1, 1, 1);
            actual = service.IsOfferReserved(1, 1, 1);
            Assert.IsTrue(actual);
        }
コード例 #2
0
        protected bool IsOfferReserved(int aid)
        {
            int?offerId = service.GetOfferIdByAttractionId(aid);

            if (offerId.HasValue && User.Identity.IsAuthenticated)
            {
                return(service.IsOfferReserved(offerId.Value, service.GetClientId(User.Identity.Name)));
            }
            return(false);
        }
コード例 #3
0
 private bool IsOfferReserved(int offerId)
 {
     return(service.IsOfferReserved(offerId, AuthorizeUtil.GetUserId(service, User)));
 }
コード例 #4
0
 private void ConfigureViewBag(tAtrakcjeUslugi attraction, int?userId)
 {
     ViewBag.CanReserve = service.IsOfferReserved(attraction.IDOferty, userId);
     ViewBag.IsReserved = IsAttractionReserved(attraction.IDAtrakcjiUslugi);
 }