public async Task <ActionResult> AddRoom(int projectId, int roomTypeId, string name)
        {
            try
            {
                //TODO: Implement room names checking
                //TODO: Implement new rooms HTML returning
                await _accommodationService.AddRooms(projectId, roomTypeId, name);

                return(StatusCode(201));
            }
            catch (Exception e) when(e is ArgumentException || e is JoinRpgEntityNotFoundException)
            {
            }
            catch
            {
                return(StatusCode(500));
            }
            return(BadRequest());
        }
Beispiel #2
0
        public async Task <ActionResult> AddRoom(int projectId, int roomTypeId, string name)
        {
            try
            {
                //TODO: Implement room names checking
                //TODO: Implement new rooms HTML returning
                await _accommodationService.AddRooms(projectId, roomTypeId, name);

                return(new HttpStatusCodeResult(HttpStatusCode.Created));
            }
            catch (Exception e) when(e is ArgumentException || e is JoinRpgEntityNotFoundException)
            {
            }
            catch
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }