public async Task <ActionResult> EditRoom(int projectId, int roomTypeId, string room, string name)
        {
            try
            {
                if (int.TryParse(room, out var roomId))
                {
                    await _accommodationService.EditRoom(roomId, name, projectId, roomTypeId);

                    return(Ok());
                }
            }
            catch (Exception e) when(e is ArgumentException || e is JoinRpgEntityNotFoundException)
            {
            }
            catch
            {
                return(StatusCode(500));
            }
            return(BadRequest());
        }
示例#2
0
        public async Task <ActionResult> EditRoom(int projectId, int roomTypeId, string room, string name)
        {
            try
            {
                if (int.TryParse(room, out int roomId))
                {
                    await _accommodationService.EditRoom(roomId, name, projectId, roomTypeId);

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