protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { string str = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionTeamMemberId")).Text; string ddlSelectedValue = ((DropDownList)sender).SelectedValue; if (ddlSelectedValue == "Edit") { FillTeamMember(); ddlTeamMemberType.Enabled = false; int editid = 0; int.TryParse(str, out editid); ViewState["currentId"] = Convert.ToInt16(str); clsTeamMember ccm = new clsTeamMember(); clsTeamMemberController ccmc = new clsTeamMemberController(); DataTable dt = new DataTable(); dt = ccmc.GetTeamNameByTeamID(TeamID); if (dt.Rows.Count > 0) { lbl_Team_Member.Text = dt.Rows[0]["TeamName"].ToString(); } FillTeamMemberType(); ClearData(); DataTable dt1 = new clsTeamMemberController().GetTeamMemberDetailByTeamMemberID(editid); if (dt1.Rows.Count > 0) { ViewState["currentId"] = Convert.ToInt32(dt1.Rows[0]["TeamMemberID"].ToString()); ViewState["regiId"] = Convert.ToInt32(dt1.Rows[0]["RegistrationId"].ToString()); ddlSelectMember.SelectedValue = dt1.Rows[0]["RegistrationId"].ToString(); txtTeamMemberJerseyNo.Text = dt1.Rows[0]["TeamMemberJerseyNo"].ToString(); txtTeamMemberJerseyName.Text = dt1.Rows[0]["TeamMemberJerseyName"].ToString(); txtTeamMemberFamousname.Text = dt1.Rows[0]["TeamMemberFamousName"].ToString(); ddlTeamMemberType.SelectedValue = dt1.Rows[0]["TeamMemberTypeId"].ToString(); } btnUpdateTeamMember.Visible = true; btnSaveTeamMember.Visible = false; pnlEntryTeamMember.Visible = true; pnlGridTeamMember.Visible = false; } else if (ddlSelectedValue == "Delete") { //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "DeleteSuccessfully();", true); //int documentid = 0; //int.TryParse(str, out documentid); //new CompetitionSponsorController().DeleteCompeSpon(documentid); //LoadDocumentsGrid(CompetitionID); } }
private void FillTeamName() { clsTeamMember ccm = new clsTeamMember(); clsTeamMemberController ccmc = new clsTeamMemberController(); DataTable dt = new DataTable(); dt = ccmc.GetTeamNameByTeamID(TeamID); if (dt.Rows.Count > 0) { lbl_Team_Member.Text = dt.Rows[0]["TeamName"].ToString(); } }
private void FillTeamMember() { clsTeamMember ccm = new clsTeamMember(); clsTeamMemberController ccmc = new clsTeamMemberController(); DataTable dt = new DataTable(); dt = ccmc.GetTeamMemberDetail(); if (dt.Rows.Count > 0) { ddlSelectMember.DataSource = dt; ddlSelectMember.DataTextField = "TeamMemberName"; ddlSelectMember.DataValueField = "RegistrationId"; ddlSelectMember.DataBind(); ddlSelectMember.Items.Insert(0, new ListItem("-- Select --", "0")); } }
public void FillTeamMemberType() { clsTeamMember ccm = new clsTeamMember(); clsTeamMemberController ccmc = new clsTeamMemberController(); DataTable dt = new DataTable(); dt = ccmc.GetTeamMemberType(); if (dt.Rows.Count > 0) { ddlTeamMemberType.DataSource = dt; ddlTeamMemberType.DataTextField = "TeamMemberTypeValue"; ddlTeamMemberType.DataValueField = "TeamMemberTypeId"; ddlTeamMemberType.DataBind(); ddlTeamMemberType.Items.Insert(0, new ListItem("-- Select --", "0")); } }
protected void btnUpdateTeamMember_Click(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "UpdateSuccessfully();", true); clsTeamMember ccm = new clsTeamMember(); clsTeamMemberController ccmc = new clsTeamMemberController(); ccm.TeamMemberID = Convert.ToInt32(currentId); ccm.TeamID = TeamID; ccm.RegistrationId = Convert.ToInt32(regiId); ccm.TeamMemberTypeId = Convert.ToInt32(ddlTeamMemberType.SelectedValue); if (txtTeamMemberJerseyNo.Text == " ") { ccm.TeamMemberJerseyNo = 0; } else { ccm.TeamMemberJerseyNo = Convert.ToInt32(txtTeamMemberJerseyNo.Text); } ccm.TeamMemberJerseyName = txtTeamMemberJerseyName.Text.Trim(); ccm.TeamMemberFamousName = txtTeamMemberFamousname.Text.Trim(); ccm.PortalId = PortalId; ccm.ModifiedById = currentUser.Username; // Call Update Method ccmc.UpdateTeamMember(ccm); btnAddTeamMember.Visible = true; pnlGridTeamMember.Visible = true; btnSaveTeamMember.Visible = true; btnUpdateTeamMember.Visible = false; FillTeamName(); LoadDocumentsGrid(TeamID); ClearData(); //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClubMember", "ClubID=" + ClubID)); }