From: <ro...@us...> - 2006-08-01 20:57:19
|
Revision: 256 Author: rouquin Date: 2006-08-01 13:57:11 -0700 (Tue, 01 Aug 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=256&view=rev Log Message: ----------- Fixed a couple lists that were showing duplicate entries, etc. Modified Paths: -------------- Website/Administration.aspx Website/Includes/AdministrationTree.ascx.cs Website/Includes/RoleAdmin.ascx Website/Includes/Roles.ascx Website/Includes/Roles.ascx.cs Modified: Website/Administration.aspx =================================================================== --- Website/Administration.aspx 2006-08-01 20:39:33 UTC (rev 255) +++ Website/Administration.aspx 2006-08-01 20:57:11 UTC (rev 256) @@ -14,7 +14,7 @@ <asp:Image ID="newUserIcon" runat="server" SkinID="newUserImage" AlternateText="New User" />New User</asp:LinkButton></div> <div class="button"> - <asp:LinkButton ID="userRole" runat="server" PostBackUrl="~/AdminRole.aspx?p=1"> + <asp:LinkButton ID="userRole" runat="server" PostBackUrl="~/AdminRole.aspx"> <asp:Image ID="userRoleIcon" runat="server" SkinID="userRoleImage" AlternateText="User Roles" />User Roles</asp:LinkButton></div> </td> Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-08-01 20:39:33 UTC (rev 255) +++ Website/Includes/AdministrationTree.ascx.cs 2006-08-01 20:57:11 UTC (rev 256) @@ -346,23 +346,22 @@ { tcdbDataSetTableAdapters.db_roleProductUserTableAdapter userAdapter = new tcdbDataSetTableAdapters.db_roleProductUserTableAdapter(); tcdbDataSet.db_roleProductUserDataTable userTable = userAdapter.GetData(null, Convert.ToInt32(parent.Parent.Value), null); + int lastID = -1; foreach (tcdbDataSet.db_roleProductUserRow row in userTable) { + if (lastID == row.userID) + continue; + else + lastID = row.userID; + // Create the new node. TreeNode newNode = new TreeNode(); newNode.Text = row.fullName; newNode.Value = row.userID.ToString(); ; - - // Set the PopulateOnDemand property to true so that the child nodes can be - // dynamically populated. newNode.PopulateOnDemand = true; - - // Set additional properties for the node. newNode.SelectAction = TreeNodeSelectAction.Expand; newNode.NavigateUrl = "~/UserSettings.aspx?"+Constants.CODE_USER+"=" + newNode.Value; - - // Add the new node to the ChildNodes collection of the parent node. parent.ChildNodes.Add(newNode); newNode.Expand(); } Modified: Website/Includes/RoleAdmin.ascx =================================================================== --- Website/Includes/RoleAdmin.ascx 2006-08-01 20:39:33 UTC (rev 255) +++ Website/Includes/RoleAdmin.ascx 2006-08-01 20:57:11 UTC (rev 256) @@ -7,12 +7,22 @@ <asp:DropDownList ID="roleList" runat="server" DataSourceID="RoleDataSource" DataTextField="roleName" DataValueField="roleID"> </asp:DropDownList><asp:ObjectDataSource ID="RoleDataSource" runat="server" OldValuesParameterFormatString="original_{0}" - SelectMethod="GetData" TypeName="tcdbDataSetTableAdapters.db_roleUserProductTableAdapter"> + SelectMethod="GetData" TypeName="tcdbDataSetTableAdapters.db_roleTableAdapter" InsertMethod="Insert" UpdateMethod="Update"> <SelectParameters> - <asp:Parameter Name="userID" Type="Int32" /> - <asp:SessionParameter Name="productID" SessionField="product" Type="Int32" /> + <asp:Parameter Name="roleID" Type="Int32" /> + <asp:Parameter Name="roleName" Type="String" /> <asp:Parameter DefaultValue="true" Name="active" Type="Boolean" /> </SelectParameters> + <UpdateParameters> + <asp:Parameter Name="roleID" Type="Int32" /> + <asp:Parameter Name="roleName" Type="String" /> + <asp:Parameter Name="roleDescription" Type="String" /> + <asp:Parameter Name="active" Type="Boolean" /> + </UpdateParameters> + <InsertParameters> + <asp:Parameter Name="roleName" Type="String" /> + <asp:Parameter Name="roleDescription" Type="String" /> + </InsertParameters> </asp:ObjectDataSource> <asp:LinkButton ID="addRoleBtn" runat="server" CommandName="addRole" OnCommand="addRole">Add User To Role</asp:LinkButton> Modified: Website/Includes/Roles.ascx =================================================================== --- Website/Includes/Roles.ascx 2006-08-01 20:39:33 UTC (rev 255) +++ Website/Includes/Roles.ascx 2006-08-01 20:57:11 UTC (rev 256) @@ -180,8 +180,8 @@ <td colspan="2" align="left" valign="top" width="34%"> <strong>Rights: <asp:LinkButton ID="newRight" runat="server" CommandName="newRight" OnCommand="newRight">New Right</asp:LinkButton><br /> - </strong> <asp:ListBox ID="rightsList" runat="server" DataSourceID="RoleDataSource" - DataTextField="roleName" DataValueField="roleID" SelectionMode="Multiple" Height="150px" Width="150px"></asp:ListBox> + </strong> <asp:ListBox ID="rightsList" runat="server" DataSourceID="RightsDataSource" + DataTextField="rightsName" DataValueField="rightsID" SelectionMode="Multiple" Height="150px" Width="150px"></asp:ListBox> </td> </tr> <tr> Modified: Website/Includes/Roles.ascx.cs =================================================================== --- Website/Includes/Roles.ascx.cs 2006-08-01 20:39:33 UTC (rev 255) +++ Website/Includes/Roles.ascx.cs 2006-08-01 20:57:11 UTC (rev 256) @@ -23,7 +23,6 @@ int roleID = Convert.ToInt32(HttpContext.Current.Request.QueryString[Constants.CODE_ROLE]); Role role; String mode = HttpContext.Current.Request.QueryString["mode"]; - String product = HttpContext.Current.Request.QueryString[Constants.CODE_PRODUCT]; protected void Page_Load(object sender, EventArgs e) { @@ -252,35 +251,16 @@ ListBox userList = (ListBox)FormView1.FindControl("userList"); updateProductUsers(productList, userList); - if (product != null) - productList.SelectedValue = product; Session["product"] = productList.SelectedValue; userList.DataBind(); } protected void productListInsert_DataBound(object sender, EventArgs e) { DropDownList productList = (DropDownList)sender; + ListBox userList = (ListBox)FormView1.FindControl("userList"); - // Initialize Product Users - if (Session["ProductUsers"] == null) - Session.Add("ProductUsers", new Dictionary<String, ArrayList>()); - Dictionary<String, ArrayList> ProductUsers = (Dictionary<String, ArrayList>)Session["ProductUsers"]; - - ProductUsers.Clear(); - foreach (ListItem productItem in productList.Items) - { - ArrayList users = new ArrayList(); - String productID = productItem.Value; - - if (ProductUsers.ContainsKey(productID)) - ProductUsers[productID] = users; - else - ProductUsers.Add(productID, users); - } - - // Init productList - if (product != null) - productList.SelectedValue = product; + updateProductUsers(productList, userList); + Session["product"] = productList.SelectedValue; } protected void ProductUserPanel_Init(object sender, EventArgs e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |