public ActionResult AddArea(AddAreaModel area) { if (!ModelState.IsValid) { return(HttpResponseHelper.Error()); } var baseArea = _eventService.CreateEventArea(_mapper.Map <EventAreaDto>(area)); return(HttpResponseHelper.Ok(new { Area = baseArea })); }
public ActionResult Select(int id) { try { var basketTime = _eventService.ReserveSeat(id, User.GetUserId()); Response.Cookies.Set(basketTime.Value.ToJsCookieTime()); ConfigureScheduler(); return(HttpResponseHelper.Ok()); } catch (Exception e) { return(HttpResponseHelper.Error()); } }
public ActionResult ChangeMainArea(AreaDto area) { if (!ModelState.IsValid) { return(HttpResponseHelper.Error()); } try { _venueService.UpdateArea(area); return(HttpResponseHelper.Ok()); } catch (Exception e) { return(HttpResponseHelper.Error()); } }
public ActionResult AddSeat(AddSeatModel model) { if (!ModelState.IsValid) { return(HttpResponseHelper.Error()); } try { var baseSeat = _eventService.AddSeat(_mapper.Map <EventSeatDto>(model)); return(HttpResponseHelper.Ok(new { Seat = baseSeat })); } catch (EntityException e) { return(HttpResponseHelper.Error()); } }
public ActionResult Deselect(int id) { try { var basketTime = _eventService.UnReserveSeat(id, User.GetUserId()); if (basketTime.HasValue) { Response.Cookies.Set(basketTime.Value.ToJsCookieTime()); } else { Response.Cookies["basketTime"].Expires = DateTime.Now.AddDays(-1); } return(HttpResponseHelper.Ok()); } catch { return(HttpResponseHelper.Error()); } }
public ActionResult DeleteEvent(int id) { var removeId = _eventService.RemoveEvent(id); return(removeId > 0 ? HttpResponseHelper.Ok() : HttpResponseHelper.Error()); }