protected void btnSub_Click(object sender, EventArgs e) { string sportID = Request.QueryString["SportID"]; TeamServiceClient teamClient = new TeamServiceClient(); Team _team = new Team(); // _team.Type = txtType.Text; _team.ID = Convert.ToInt32(sportID); _team.Name = txtName.Value; _team.Desc = txtDesc.Value; _team.NumPlayers = Convert.ToInt32(txtNumPlayer.Text); _team.Category = txtCategory.Value; string res = teamClient.EditTeam(_team); if (res.ToLower().Contains("success")) { //Upload Team Image ImageFile img = new ImageFile(); img = UploadFile(flImage, Convert.ToString(sportID), "Team_Images", "Teams"); //Upload Event Main's Image to client directory FileClient fc = new FileClient(); if (img != null) { string res1 = fc.saveTeamImage(img); //Upload Event Main's Image to Database string number = res1; } //pop-up done! Response.Redirect("ViewTeam.aspx?SportID=" + sportID); } }
protected void btnEdit_Click(object sender, EventArgs e) { TeamServiceClient teamClient = new TeamServiceClient(); Team _team = new Team(); // _team.Type = txtType.Text; _team.ID = 1; _team.Name = txtName.Text; _team.Desc = txtDesc.Text; _team.NumPlayers = Convert.ToInt32(txtNumPlayers.Text); string res = teamClient.EditTeam(_team); }