Ejemplo n.º 1
0
        /// <summary>
        /// 団体申請情報を取得したDtoからViewModelを生成します。
        /// </summary>
        public static RequestContinuedTeamViewModel FromDto(GetRequestTeamStateDto requestTeamState)
        {
            var viewModel = new RequestContinuedTeamViewModel
            {
                SeasonName         = requestTeamState.SeasonName,
                TeamCode           = requestTeamState.TeamCode,
                TeamName           = requestTeamState.TeamName,
                RepresentativeName = requestTeamState.RepresentativeName,
                TeamId             = requestTeamState.TeamId,
                TeamType           = requestTeamState.TeamType,
                SeasonId           = requestTeamState.SeasonId,
                RequestedFee       = requestTeamState.RequestedFee,
                IsRequestDone      = requestTeamState.IsRequestDone,
            };

            if (viewModel.IsRequestDone)
            {
                viewModel.DisplayMessage = requestTeamState.IsApproved ? "受領しました。" : "申請済みです。";
            }
            else
            {
                viewModel.DisplayMessage        = $"{requestTeamState.SeasonName}の継続登録申込を行います。";
                viewModel.IsDisplaySubmitButton = true;
            }
            return(viewModel);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> RequestContinuedTeam(int teamId)
        {
            try
            {
                var requestTeamState = await this.useCase.GetRequestTeamState(teamId);

                return(this.View(RequestContinuedTeamViewModel.FromDto(requestTeamState)));
            }
            catch (NotFoundException)
            {
                return(this.NotFound());
            }
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> RequestContinuedTeam([Bind(
                                                                   "TeamId",
                                                                   "TeamType",
                                                                   "RequestedFee",
                                                                   "SeasonId")]
                                                              RequestContinuedTeamViewModel model)
        {
            try
            {
                // RequestTeamの発行
                var dto = model.ToDto();
                await this.useCase.AddRequestTeam(dto);

                return(this.RedirectToAction(nameof(RequestContinuedTeam), new { teamId = model.TeamId }));
            }
            catch (NotFoundException)
            {
                return(this.NotFound());
            }
        }