Ejemplo n.º 1
0
        public async Task <IActionResult> AddTeam(AddTeamModel model, IFormCollection TeamBadgeURL)
        {
            var    webRoot   = _environment.WebRootPath;
            string teamId    = Convert.ToString(TeamBadgeURL["Id"]);
            string storePath = "/images/teams/";
            var    path      = Path.Combine(
                Directory.GetCurrentDirectory(), "wwwroot", "images", "teams",
                TeamBadgeURL.Files[0].FileName);

            using (var stream = new FileStream(path, FileMode.Create))
            {
                await TeamBadgeURL.Files[0].CopyToAsync(stream);
            }


            var team = new Teams
            {
                TeamName          = model.TeamName,
                Nickname          = model.Nickname,
                TeamBadgeUrl      = storePath + model.ImageT1.FileName,
                YearFounded       = model.YearFounded,
                WorldwideFans     = model.WorldwideFans,
                AverageAttendance = model.AverageAttendance,
                SocialFollowing   = model.SocialFollowing,
                ClubValue         = model.ClubValue,
                LeagueId          = model.LeagueId
            };
            await _teamService.Create(team);

            return(RedirectToAction("Index", "Teams"));
        }
Ejemplo n.º 2
0
    public IActionResult AddTeams([FromRoute] Guid tournamentId, [FromBody] AddTeamModel model)
    {
        var traceId    = Guid.NewGuid();
        var tournament = _clusterClient.GetGrain <ITournamentGrain>(tournamentId);

        tournament.AddTeamAsync(new AddTeam(tournamentId, model.TeamId, traceId, GetUserId));
        return(Ok(new TraceResponse(traceId)));
    }
Ejemplo n.º 3
0
        public IActionResult Create()
        {
            var model   = new AddTeamModel();
            var leagues = _db.Leagues.OrderBy(c => c.LeagueName)
                          .Select(x => new { Id = x.Id, Value = x.LeagueName });

            model.LeagueList = new SelectList(leagues, "Id", "Value");

            return(View(model));
        }
        private void Button_AddTeam_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            Label_ErrorMessage_TeamAdd.Text = "";

            AddTeamModel      addTeamMd = new AddTeamModel();
            AddTeamController addTeamCt = new AddTeamController();

            addTeamMd.teamMemberName    = Text_Team_Fullname.Text;
            addTeamMd.teamMemberAddress = Text_Team_Address.Text;
            addTeamMd.teamMemberContact = Text_Team_ContactNumber.Text;
            addTeamMd.sendSMSCheck      = CheckBox_SendSMS_teamAdd.Checked;

            if (addTeamCt.saveTeamMember(addTeamMd))
            {
                if (addTeamCt.smsChecked(addTeamMd))
                {
                    NotifySMS sms = new NotifySMS();

                    if (sms.loginSMS())
                    {
                        if (sms.teamAddSMS(addTeamMd))
                        {
                            MessageBox.Show("Team Member was Notified Via SMS");
                        }
                        else
                        {
                            MessageBox.Show("The Member was not notified via SMS", "Somthing Went Wrong");
                        }
                    }
                    else
                    {
                        MessageBox.Show("SMS Not Sent", "The Login Failed");
                    }
                }

                Label_ErrorMessage_TeamAdd.Text = addTeamMd.errorMessage;
                clearFeilds();
                loadTeamMembersGrid();

                new FormNewCase();
            }
            else
            {
                Label_ErrorMessage_TeamAdd.Text = addTeamMd.errorMessage;
            }
        }
        public bool teamAddSMS(AddTeamModel addTeamMd)
        {
            string teamAddMessage = "Greetings Dear " + addTeamMd.teamMemberName + ". You have been successfully added to Imdaad Foundation Suite 1.0. Thank you for being part of Imdaad Foundation.";

            try
            {
                bool status3 = wts.SendSms(addTeamMd.teamMemberContact, teamAddMessage);
                if (status3)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
        }