Esempio n. 1
0
        public async Task Add(TeamAddModel team)
        {
            await repository.Add(new KadabraTeam()
            {
                CountryId = team.CountryId,
                ImageFlag = team.ImageFlag,
                Name      = team.Name,
                TeamKey   = team.TeamKey,
                Id        = Guid.NewGuid().ToString()
            });

            await repository.Save();
        }
Esempio n. 2
0
        private TeamAddModel GetAddData()
        {
            var model = new TeamAddModel
            {
                Command = new AddTeamCommand()
                {
                    Season   = enuSeason.s2017_2018,
                    Category = enuCategory.CMV
                }
            };

            return(model);
        }
Esempio n. 3
0
        public async Task <ActionResult> AddTeam(TeamAddModel team)
        {
            if (ModelState.IsValid)
            {
                await teamService.Add(team);

                return(RedirectToAction("Index"));
            }
            else
            {
                var model = await teamService.GetTeamWithCountries();

                return(View("Add", model));
            }
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> AddTeam(TeamAddModel team)
        {
            if (!ModelState.IsValid)
            {
                return(this.InternalServerError());
            }
            try
            {
                await services.Add(team);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Esempio n. 5
0
        public async Task Add(TeamAddModel team)
        {
            HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Team/AddTeam", team);

            response.EnsureSuccessStatusCode();
        }