protected void btnUpdateUserRole_Click(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "UpdateSuccessfully();", true); clsUserRole ccm = new clsUserRole(); clsUserRoleController ccmc = new clsUserRoleController(); ccm.UserRoleId = Convert.ToInt16(currentId); ccm.UserRoleName = txtUserRole.Text.Trim(); ccm.UserRoleAbbr = txtUserRoleAbbr.Text.Trim(); ccm.UserRoleDesc = txtUserRoleDesc.Text.Trim(); ccm.PortalId = PortalId; ccm.ModifiedById = currentUser.Username; // Call Update Method ccmc.UpdateUserRole(ccm); btnAddUserRole.Visible = true; pnlUserRoleGrid.Visible = true; btnSaveUserRole.Visible = true; btnUpdateUserRole.Visible = false; LoadDocumentsGrid(); ClearData(); //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "frmClubMember", "ClubID=" + ClubID)); }
public void LoadDocumentsGrid() { DataTable dt = new DataTable(); clsUserRoleController ccmc = new clsUserRoleController(); dt = ccmc.GetUserRoleList(); if (dt.Rows.Count > 0) { gvUserRole.DataSource = dt; gvUserRole.DataBind(); } }
protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e) { string str = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionUserRoleId")).Text; string ddlSelectedValue = ((DropDownList)sender).SelectedValue; if (ddlSelectedValue == "Edit") { int editid = 0; int.TryParse(str, out editid); ViewState["currentId"] = Convert.ToInt16(str); clsUserRole ccm = new clsUserRole(); clsUserRoleController ccmc = new clsUserRoleController(); ClearData(); DataTable dt1 = new clsUserRoleController().GetUserRoleDetailByUserRoleID(editid); if (dt1.Rows.Count > 0) { txtUserRole.Text = dt1.Rows[0]["UserRoleName"].ToString(); txtUserRoleAbbr.Text = dt1.Rows[0]["UserRoleAbbr"].ToString(); txtUserRoleDesc.Text = dt1.Rows[0]["UserRoleDesc"].ToString(); } btnUpdateUserRole.Visible = true; btnSaveUserRole.Visible = false; pnlUserRoleEntry.Visible = true; pnlUserRoleGrid.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); } }