Ejemplo n.º 1
0
        protected void lnkSubmit_Click(object sender, EventArgs e)
        {
            string LeagueID = Request.QueryString["LeagueID"];


            Game game = new Game();

            game.TeamOne  = txtTeamOne.Value;
            game.TeamTwo  = txtTeamTwo.Value;
            game.Venue    = txtVenue.Value;
            game.sDate    = DateTime.ParseExact(txtDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = Convert.ToInt32(LeagueID);
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues"); //uploading an image
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;

            Response.Redirect("ViewGame.aspx?G_ID=" + GameID);
        }
Ejemplo n.º 2
0
        protected void btnMatch_Click(object sender, EventArgs e)
        {
            Game game = new Game();

            game.TeamOne  = txtTeamOne.Text;
            game.TeamTwo  = txtTeamTwo.Text;
            game.Venue    = txtVenue.Text;
            game.Type     = txtGameType.Text;
            game.sDate    = DateTime.ParseExact(txtGameDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = 14;
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flGameImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues");
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;
        }
Ejemplo n.º 3
0
        protected void lnkSubmit_Click(object sender, EventArgs e)
        {
            string LeagueID = Request.QueryString["LeagueID"];

            //Populate dropdownlist
            //TeamServiceClient teamClient = new TeamServiceClient();
            //List<rep_Teams> teams = teamClient.getLeagueTeams(LeagueID);
            //dl_Teams.DataSource = teams;
            //dl_Teams.DataTextField = "Name";
            //dl_Teams.DataValueField = "S_ID";
            //dl_Teams.DataBind();

            if (dl_Teams.SelectedValue.Equals(d2_Teams.SelectedValue))
            {
                Response.Redirect("AddGame.aspx?LeagueID=" + LeagueID);
            }

            Game game = new Game();

            game.TeamOne  = dl_Teams.Text;
            game.TeamTwo  = d2_Teams.Text;
            game.Venue    = txtVenue.Value;
            game.sDate    = DateTime.ParseExact(txtDate.Text, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            game.LeagueID = Convert.ToInt32(LeagueID);
            makeLeagueDirectory(Convert.ToString(game.LeagueID));
            MatchServiceClient msc = new MatchServiceClient();
            int GameID             = msc.AddMatch(game);
            //Upload Game Image
            ImageFile img = new ImageFile();

            img           = UploadFile(flImage, Convert.ToString(game.LeagueID), "Game_Images", "Leagues");
            img.foreignID = Convert.ToString(GameID);
            FileClient fc     = new FileClient();
            string     res1   = fc.saveGameImage(img);
            string     number = res1;

            Response.Redirect("ViewGame.aspx?G_ID=" + GameID);
        }