private void FillTeamMember(int TeamID) { clsNews e = new clsNews(); clsNewsController ec = new clsNewsController(); DataTable dt = new DataTable(); dt = ec.GetTeamMemberIDAndTeamMemberName(TeamID); if (dt.Rows.Count > 0) { ddlTeamMember.DataSource = dt; ddlTeamMember.DataTextField = "TeamMemberName"; ddlTeamMember.DataValueField = "TeamMemberID"; ddlTeamMember.DataBind(); ddlTeamMember.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillClubOwner(int ClubID) { clsNews e = new clsNews(); clsNewsController ec = new clsNewsController(); DataTable dt = new DataTable(); dt = ec.GetClubOwnerIDAndClubOwnerName(ClubID); if (dt.Rows.Count > 0) { ddlClubOwner.DataSource = dt; ddlClubOwner.DataTextField = "ClubOwnerName"; ddlClubOwner.DataValueField = "ClubOwnersId"; ddlClubOwner.DataBind(); ddlClubOwner.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillPlayer(int TeamID) { clsNews e = new clsNews(); clsNewsController ec = new clsNewsController(); DataTable dt = new DataTable(); dt = ec.GetPlayerIDAndPlayerNameByTeamID(TeamID); if (dt.Rows.Count > 0) { ddlPlayer.DataSource = dt; ddlPlayer.DataTextField = "PlayerName"; ddlPlayer.DataValueField = "RegistrationId"; ddlPlayer.DataBind(); ddlPlayer.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillSponsor() { clsNews e = new clsNews(); clsNewsController ec = new clsNewsController(); DataTable dt = new DataTable(); dt = ec.GetSponsorIDAndSponsorName(); if (dt.Rows.Count > 0) { ddlSponsor.DataSource = dt; ddlSponsor.DataTextField = "SponsorName"; ddlSponsor.DataValueField = "SponsorId"; ddlSponsor.DataBind(); ddlSponsor.Items.Insert(0, new ListItem("-- Select --", "0")); } }
private void FillCountry() { clsNews e = new clsNews(); clsNewsController ec = new clsNewsController(); DataTable dt = new DataTable(); dt = ec.FillCountryIDAndCountryName(); if (dt.Rows.Count > 0) { ddlCountry.DataSource = dt; ddlCountry.DataTextField = "CountryName"; ddlCountry.DataValueField = "CountryID"; ddlCountry.DataBind(); ddlCountry.Items.Insert(0, new ListItem("-- Select --", "0")); } }
protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { string str = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionNewsID")).Text; string ddlSelectedValue = ((DropDownList)sender).SelectedValue; if (ddlSelectedValue == "Edit") { funClearData(); FillSport(); FillCountry(); FillEvent(); FillSeason(); FillCompetition(); FillClub(); FillClubOwner(); FillClubMember(); FillTeam(); FillTeamMember(); FillPlayer(); FillSponsor(); int NewsID = 0; int.TryParse(str, out NewsID); LinkButton btn = sender as LinkButton; clsNews cs = new clsNews(); clsNewsController csc = new clsNewsController(); DataTable dt = new DataTable(); dt = csc.GetNewsDataByNewsID(NewsID); if (dt.Rows.Count > 0) { hidRegID.Value = dt.Rows[0]["NewsId"].ToString(); ddlSports.SelectedValue = dt.Rows[0]["SportId"].ToString(); ddlSeason.SelectedValue = dt.Rows[0]["SeasonId"].ToString(); ddlCompetition.SelectedValue = dt.Rows[0]["CompetitionId"].ToString(); ddlClub.SelectedValue = dt.Rows[0]["ClubId"].ToString(); ddlClubOwner.SelectedValue = dt.Rows[0]["ClubOwnersId"].ToString(); ddlClubMember.SelectedValue = dt.Rows[0]["ClubMemberId"].ToString(); ddlTeam.SelectedValue = dt.Rows[0]["TeamId"].ToString(); ddlTeamMember.SelectedValue = dt.Rows[0]["TeamMemberId"].ToString(); ddlPlayer.SelectedValue = dt.Rows[0]["PlayerId"].ToString(); ddlEvent.SelectedValue = dt.Rows[0]["EventId"].ToString(); ddlSponsor.SelectedValue = dt.Rows[0]["SponsorId"].ToString(); ddlCountry.SelectedValue = dt.Rows[0]["CountryID"].ToString(); ddlNewsPriority.SelectedValue = dt.Rows[0]["NewsLevelId"].ToString(); txtNewsTitle.Text = dt.Rows[0]["NewsTitle"].ToString(); txtNewsDesc.Text = dt.Rows[0]["NewsDesc"].ToString(); txtNewText.Text = dt.Rows[0]["NewsText"].ToString(); txtNewsDate.Text = dt.Rows[0]["NewsDate"].ToString(); NewsLogoImage.ImageUrl = dt.Rows[0]["NewsPicture"].ToString(); string ufname = dt.Rows[0]["NewsPicture"].ToString().Replace(" ", ""); NewsLogoFile.ResolveUrl("ufname"); txtVideoPath.Text = dt.Rows[0]["NewsVideo"].ToString(); HtmlGenericControl contentPanel1 = (HtmlGenericControl)this.FindControl("ifmOtherVideoPath"); contentPanel1.Attributes["src"] = "DesktopModules\\ThSportSite\\" + dt.Rows[0]["NewsOtherVideoPath"].ToString(); if (dt.Rows[0]["VideoType"].ToString() == "1") { ddlvideotype.SelectedValue = "YouTube"; divvideopath.Visible = true; divOtherVideoPath.Visible = false; ifmOtherVideoPath.Visible = false; } else { ddlvideotype.SelectedValue = "Other"; divvideopath.Visible = false; divOtherVideoPath.Visible = true; ifmOtherVideoPath.Visible = true; } if (dt.Rows[0]["ActiveFlagId"].ToString() == "1") { ChkIsActive.Checked = true; } else { ChkIsActive.Checked = false; } if (dt.Rows[0]["ShowFlagId"].ToString() == "1") { ChkIsShow.Checked = true; } else { ChkIsShow.Checked = false; } pnlEntryNews.Visible = true; PnlGridNews.Visible = false; btnUpdateNews.Visible = true; btnSaveNews.Visible = false; } } else if (ddlSelectedValue == "Delete") { //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "javascript:confirm('Are You Sure? Want To Delete.');", true); //Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "javascript:Confirmation();", true); //int competition_Id = 0; //int.TryParse(str, out competition_Id); //CompRegInfo.DeleteCompetitionReg(competition_Id); //FillGridView(); } }