CreateRole.aspx 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Util.Master" CodeBehind="CreateRole.aspx.cs" Inherits="Mainsoft.Web.Administration.CreateRole" %>
  2. <%@ Register TagPrefix="custom" Assembly="Mainsoft.Web.Administration" Namespace="Mainsoft.Web.Administration" %>
  3. <asp:Content ID="Main" ContentPlaceHolderID="Main" runat="server">
  4. <!--
  5. // Mainsoft.Web.Administration - Site administration utility
  6. // Authors:
  7. // Klain Yoni <[email protected]>
  8. //
  9. // Mainsoft.Web.Administration - Site administration utility
  10. // (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
  29. <asp:MultiView runat="server" ID="mv" ActiveViewIndex="0">
  30. <asp:View runat="server" id="grid">
  31. <table class="maintable">
  32. <tr>
  33. <td colspan="2" width="100%" style="height: 21px">
  34. You can optionally add roles, or groups, that enable you to allow or deny groups of users access to specific folders in your Web site. For example, you might create roles such as "managers," "sales," or "members," each with different access to specific folders. <br /> <br />
  35. </td>
  36. </tr>
  37. <tr>
  38. <td width= "100%" valign="top">
  39. <table width="100%" class="innertable" >
  40. <tr>
  41. <td width="100%" class="controlheader">
  42. Create New Role
  43. </td>
  44. </tr>
  45. <tr>
  46. <td>
  47. New role name: &nbsp; &nbsp;
  48. <asp:TextBox ID="roleName_txb" runat="server" /> &nbsp; &nbsp;
  49. <asp:Button ID="roleName_bt" runat="server" Text="Add role" OnClick="roleName_bt_Click" />
  50. </td>
  51. </tr>
  52. <tr>
  53. <td>
  54. <asp:Label ID="error_lb" runat="server" ForeColor="Red" />
  55. <br /> <br />
  56. </td>
  57. </tr>
  58. </table>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td width= "100%" valign="top" datakeynames="Role;">
  63. <asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" DataKeyNames="Role">
  64. <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  65. <Columns>
  66. <asp:BoundField DataField="Role" HeaderText="Role Name" >
  67. <HeaderStyle HorizontalAlign="Left" />
  68. </asp:BoundField>
  69. <asp:HyperLinkField DataNavigateUrlFields="Role" DataNavigateUrlFormatString="~/ManageRole.aspx?Role={0}"
  70. HeaderText="Add\Remove Role" Text="Manage" >
  71. <HeaderStyle HorizontalAlign="Left" />
  72. </asp:HyperLinkField>
  73. <asp:TemplateField>
  74. <ItemTemplate>
  75. <custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("Role") %>' OnClick="gridbtn_click" >Delete</custom:GridButton>
  76. </ItemTemplate>
  77. </asp:TemplateField>
  78. </Columns>
  79. <RowStyle BackColor="#EFF3FB" />
  80. <EditRowStyle BackColor="#2461BF" />
  81. <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  82. <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  83. <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
  84. ForeColor="White" HorizontalAlign="Center" />
  85. <AlternatingRowStyle BackColor="White" />
  86. </asp:GridView>
  87. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
  88. SelectMethod="Select" TypeName="Mainsoft.Web.Administration.RolesDS">
  89. <DeleteParameters>
  90. <asp:Parameter Name="Role" Type="String" />
  91. </DeleteParameters>
  92. </asp:ObjectDataSource>
  93. </td>
  94. </tr>
  95. </table>
  96. </asp:View>
  97. <asp:View runat="server" ID="yesno" >
  98. <table class="innertable" width="60%">
  99. <tr>
  100. <td style="height: 80px" valign="top">
  101. <br />
  102. <img src="Images/untitled.bmp" /> &nbsp;
  103. Are you sure you want to delete the role: "<%= Role %>"?
  104. <br />
  105. </td>
  106. </tr>
  107. <tr>
  108. <td align="right" style="background-color:inactivecaptiontext" >
  109. <asp:Button ID="yes" runat="server" Text="Yes" style="width:50px" OnClick="Click_Yes" />
  110. <asp:Button ID="no" runat="server" Text="No" style="width:50px" OnClick="Click_No" />
  111. </td>
  112. </tr>
  113. </table>
  114. </asp:View>
  115. </asp:MultiView>
  116. </asp:Content>