Example #1
0
        // GET api/<controller>/5
        public dynamic Get(string id)
        {
            System.Diagnostics.Trace.TraceInformation("getting room list");
            //System.Diagnostics.Trace.TraceWarning("This is a Warning");
            //System.Diagnostics.Trace.TraceError("This is an Error");
            var room     = _roomManager.GetRoomById(id);
            var location = _locationManager.GetLocationById(room.location);

            return(new { Id = room.Id, Location = new { Id = room.location, Name = location.Name, Country = location.Country }, MonitorScreen = room.MonitorScreen, Projector = room.Projector, RoomName = room.RoomName, Sitting = room.Sitting, VideoConferencing_ = room.VideoConferencing_ });
        }
Example #2
0
        // POST api/<controller>
        public async Task PostAsync([FromBody] Booking booking)
        {
            try
            {
                TApiAuth auth = new TApiAuth();
                booking.Id        = Guid.NewGuid().ToString();
                booking.createdBy = auth.GetLoggedInUsername(Request);
                booking.createdOn = DateTime.UtcNow;
                _bookingManager.AddNewBooking(booking);
                var room = _roomManager.GetRoomById(booking.RoomId);
                var user = _userManager.GetUserFromMailId(booking.createdBy);
                var loc  = _locationManager.GetLocationById(room.location);
                //await SendEmailExecute(booking, room, user,"done");
                var             host            = Request.RequestUri.Scheme + "://" + Request.RequestUri.Host + ":" + Request.RequestUri.Port;
                EmailComManager emailComManager = new EmailComManager(host);

                await emailComManager.SendRoomBookingCalenderInvite(user.email, user.Name, room.RoomName + "(" + loc.Name + ")", booking.starttime, booking.endtime);
            }catch (Exception ex)
            {
            }
        }
Example #3
0
 // GET api/<controller>/5
 public Location Get(string id)
 {
     return(_locationManager.GetLocationById(id));
 }