protected void GridView_Existing_List_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView_Existing_List.PageIndex = e.NewPageIndex; GridView_Existing_List.DataSource = (DataTable)Session[SessionFactory.ADMIN_PREF_ACCESS_MGMT_EXISTING_GROUP_DATAGRID]; GridView_Existing_List.DataBind(); GridView_Existing_List.SelectedIndex = -1; }
protected void fillAllGroupList() { String entId = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(); Dictionary <String, ArrayList> accessList = BackEndObjects.EntityAccessListRecord.getCompleteAccessListbyEntId(entId); Dictionary <String, String> existingGroupNamesList = new Dictionary <string, string>(); DataTable dt = new DataTable(); dt.Columns.Add("Group Name"); dt.Columns.Add("2"); int counter = 0; foreach (KeyValuePair <String, ArrayList> kvp in accessList) { dt.Rows.Add(); dt.Rows[counter]["Group Name"] = kvp.Key; existingGroupNamesList.Add(kvp.Key, kvp.Key); counter++; } GridView_Existing_List.DataSource = dt; GridView_Existing_List.DataBind(); Session[SessionFactory.ADMIN_PREF_ACCESS_MGMT_EXISTING_GROUP_DATAGRID] = dt; Session[SessionFactory.ADMIN_PREF_ACCESS_MGMT_EXISTING_GROUP_LIST] = existingGroupNamesList; }
protected void Button_Filter_Click(object sender, EventArgs e) { if (TextBox_Group_Name.Equals("")) { fillAllGroupList(); } else { String entId = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(); Dictionary <String, ArrayList> accessList = BackEndObjects.EntityAccessListRecord.getCompleteAccessListbyEntId(entId); DataTable dt = new DataTable(); dt.Columns.Add("Group Name"); dt.Columns.Add("2"); int counter = 0; foreach (KeyValuePair <String, ArrayList> kvp in accessList) { if (kvp.Key.IndexOf(TextBox_Group_Name.Text.Trim()) >= 0) { dt.Rows.Add(); dt.Rows[counter]["Group Name"] = kvp.Key; counter++; } } GridView_Existing_List.DataSource = dt; GridView_Existing_List.DataBind(); Session[SessionFactory.ADMIN_PREF_ACCESS_MGMT_EXISTING_GROUP_DATAGRID] = dt; } }
protected void LinkButton_Show_Purchase_Command(object sender, CommandEventArgs e) { LinkButton linkb = (LinkButton)sender; GridViewRow row = (GridViewRow)linkb.NamingContainer; if (row != null && row.RowIndex != -1 && row.RowIndex != GridView_Existing_List.SelectedIndex) { GridView_Existing_List.SelectRow(row.RowIndex); } String forwardString = "/Pages/Popups/AdminPref/ExistingGroupAccess.aspx"; String groupName = ((Label)GridView_Existing_List.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].FindControl("Label_Name")).Text; forwardString += "?groupName=" + groupName; Response.Redirect(forwardString); //Server.Transfer(forwardString); }