Example #1
0
        public IHttpActionResult AddBooking(Booking booking)
        {
            try
            {
                ActivityManager ActMgr = new ActivityManager(Unit);

                if (ActMgr.CheckAvailability(booking.ActivityId, booking.Count))
                {
                    booking.State = BaseState.Added;
                    Mgr.AddUpdate(booking);
                    Unit.SaveChanges();
                    return(Ok(booking));
                }
                else
                {
                    return(Ok(false));
                }
            }
            catch (Exception ex)
            {
                Unit.LogError(ex, this.ToString(), this.ActionContext.ActionArguments.ToList());
                return(InternalServerError(ex));
            }
        }