Ejemplo n.º 1
0
        public ActionResult SpaceBookingRequests(SpaceBooking spaceBooking)
        {
            List <SpaceBookingRequest> spaceBookings = new List <SpaceBookingRequest>();

            if (!string.IsNullOrEmpty(spaceBooking.BookingDate) && spaceBooking.SpaceId.HasValue)
            {
                SpaceBookingRequest model = new SpaceBookingRequest();
                model.FromDate = DateTime.ParseExact(spaceBooking.BookingDate, ProjectConfiguration.DateFormat, System.Globalization.CultureInfo.InvariantCulture).Date;
                model.ToDate   = model.FromDate.Value.Date.AddDays(1);
                model.SpaceId  = spaceBooking.SpaceId;
                spaceBookings  = this.masterDataBL.Search(model);
            }

            return(this.PartialView(PartialViews.SpaceBookingRequests, spaceBookings));
        }
Ejemplo n.º 2
0
        public JsonResult GetSpaceBookingRequestTimings(SpaceBooking spaceBooking)
        {
            List <SpaceBookingRequest> spaceBookings = new List <SpaceBookingRequest>();

            if (!string.IsNullOrEmpty(spaceBooking.BookingDate) && spaceBooking.SpaceId.HasValue)
            {
                SpaceBookingRequest model = new SpaceBookingRequest();
                model.FromDate = DateTime.ParseExact(spaceBooking.BookingDate, ProjectConfiguration.DateFormat, System.Globalization.CultureInfo.InvariantCulture).Date;
                model.ToDate   = model.FromDate.Value.Date.AddDays(1);
                model.SpaceId  = spaceBooking.SpaceId;
                spaceBookings  = this.masterDataBL.Search(model);
            }

            var spaceBookingRequestTimings = spaceBookings
                                             .Where(s => s.FromDate != null && s.ToDate != null)
                                             .Select(s => new { From = s.FromDate.Value.ToString("HH:mm"), To = s.ToDate.Value.ToString("HH:mm") })
                                             .ToList();

            return(this.Json(spaceBookingRequestTimings, JsonRequestBehavior.DenyGet));
        }