public ActionResult Summary([Bind(Prefix="OrderFindForm")] OrderModel model)
 {
     SummaryContext context = new SummaryContext {
         ShowOrderFindForm = true
     };
     if (base.ModelState.IsValid)
     {
         DateTime? currentDate = model.CurrentDate;
         DateTime dateFrom = currentDate.HasValue ? currentDate.GetValueOrDefault() : DateTime.Now.Date;
         List<GuestClaim> claims = GuestProvider.FindGuestClaims(UrlLanguage.CurrentLanguage, 0, model.ClaimName, new int?(Convert.ToInt32(model.Claim)), null);
         if ((claims != null) && (claims.Count > 0))
         {
             int? nullable2;
             ReservationState reservationState = BookingProvider.GetReservationState(UrlLanguage.CurrentLanguage, claims[0].claim);
             if ((reservationState != null) && (nullable2 = reservationState.claimId).HasValue)
             {
                 context.Claim = reservationState;
                 context.ShowOrderFindForm = false;
                 context.Hotels = new List<DepartureHotel>();
                 foreach (GuestClaim claim in claims)
                 {
                     nullable2 = null;
                     context.Hotels.AddRange(GuestProvider.GetDepartureInfo(UrlLanguage.CurrentLanguage, dateFrom, dateFrom.AddDays(1.0), nullable2, new int?(claim.claim)));
                 }
                 context.GuideDurties = new List<HotelGuideResult>();
                 List<GuestOrder> list2 = GuestProvider.GetActiveHotelOrders(claims, dateFrom, dateFrom.AddDays(1.0));
                 if ((list2 != null) && (list2.Count > 0))
                 {
                     GuideController controller = new GuideController();
                     foreach (GuestOrder order in list2)
                     {
                         HotelGuideParam param = new HotelGuideParam {
                             h = order.hotelid,
                             ln = UrlLanguage.CurrentLanguage,
                             pb = new DateTime?(order.period.begin.Value),
                             pe = new DateTime?(order.period.end.Value)
                         };
                         HotelGuideResult item = controller.HotelGuide(param);
                         context.GuideDurties.Add(item);
                     }
                 }
             }
         }
     }
     context.OrderFindNotFound = context.Claim == null;
     return base.View(context);
 }
 public ActionResult Index(GuestWebParams param)
 {
     GuestContext model = new GuestContext();
     if (WebSecurity.IsAuthenticated)
     {
         DateTime firstDate = ((param != null) && param.TestDate.HasValue) ? param.TestDate.Value.Date : DateTime.Now.Date;
         model.GuideDurties = new List<HotelGuideResult>();
         List<GuestOrder> list = GuestProvider.GetActiveHotelOrders(UrlLanguage.CurrentLanguage, WebSecurity.CurrentUserId, firstDate, firstDate.AddDays(1.0));
         if ((list != null) && (list.Count > 0))
         {
             GuideController controller = new GuideController();
             foreach (GuestOrder order in list)
             {
                 HotelGuideParam param2 = new HotelGuideParam {
                     h = order.hotelid,
                     ln = UrlLanguage.CurrentLanguage,
                     pb = new DateTime?(order.period.begin.Value),
                     pe = new DateTime?(order.period.end.Value)
                 };
                 HotelGuideResult item = controller.HotelGuide(param2);
                 model.GuideDurties.Add(item);
             }
         }
     }
     else
     {
         model.ShowAuthenticationMessage = true;
     }
     return base.View(model);
 }