Example #1
0
        public IActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                if (PlayerSupport.Id == 0)
                {
                    PlayerSupport       = playerSupport.Create(PlayerSupport);
                    TempData["Message"] = "The Request was sent.";
                }

                playerSupport.Commit();
                return(RedirectToPage("./RequestSent"));
            }
            Technical = htmlHelper.GetEnumSelectList <Technical>();
            return(Page());
        }
        public IActionResult Create(PlayerSupportDto playerSupportDto)
        {
            if (playerSupportDto == null)
            {
                return(BadRequest());
            }

            var playersupport = new WebProjectCore.PlayerSupport.PlayerSupport();

            playersupport.InGame      = (InGame)playerSupportDto.InGame;
            playersupport.Technical   = (Technical)playerSupportDto.Technical;
            playersupport.Account     = (Account)playerSupportDto.Account;
            playersupport.Description = playerSupportDto.Description;
            playersupport.Username    = playerSupportDto.Username;
            playersupport.Subject     = playerSupportDto.Subject;



            PSData.Create(playersupport);
            PSData.Commit();

            return(CreatedAtRoute("GetPlayerSupport", new { id = playersupport.Id }, playersupport));
        }