svn path=/trunk/mcs/; revision=70649
[mono.git] / mcs / class / Mainsoft.Web / Mainsoft.Web.AspnetConfig / aspnetconfig / Default.aspx.cs.bak
1 // Mainsoft.Web.Administration - Site administration utility\r
2 // Authors:\r
3 //  Klain Yoni <yonik@mainsoft.com>\r
4 //\r
5 // Mainsoft.Web.Administration - Site administration utility\r
6 // (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
7 // Permission is hereby granted, free of charge, to any person obtaining\r
8 // a copy of this software and associated documentation files (the\r
9 // "Software"), to deal in the Software without restriction, including\r
10 // without limitation the rights to use, copy, modify, merge, publish,\r
11 // distribute, sublicense, and/or sell copies of the Software, and to\r
12 // permit persons to whom the Software is furnished to do so, subject to\r
13 // the following conditions:\r
14 // \r
15 // The above copyright notice and this permission notice shall be\r
16 // included in all copies or substantial portions of the Software.\r
17 // \r
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
25 \r
26 using System;\r
27 using System.Data;\r
28 using System.Configuration;\r
29 using System.Collections;\r
30 using System.Web;\r
31 using System.Web.Security;\r
32 using System.Web.UI;\r
33 using System.Web.UI.WebControls;\r
34 using System.Web.UI.HtmlControls;\r
35 \r
36 namespace Mainsoft.Web.Administration\r
37 {\r
38         public partial class Default : System.Web.UI.Page\r
39         {\r
40                 protected void Page_Load (object sender, EventArgs e)\r
41                 {\r
42                         Button bt = Master.FindControl ("Back") as Button;\r
43                         if (bt != null) {\r
44                                 bt.Enabled = false;\r
45                         }\r
46                 }\r
47 \r
48                 public string User_count\r
49                 {\r
50                         get\r
51                         {\r
52                                 MembershipUserCollection user_collection = Membership.GetAllUsers ();\r
53                                 return user_collection.Count.ToString ();\r
54                         }\r
55                 }\r
56 \r
57                 public string Roles_count\r
58                 {\r
59                         get\r
60                         {\r
61                                 if (Roles.Enabled) {\r
62                                         string[] list = Roles.GetAllRoles ();\r
63                                         return list.Length.ToString ();\r
64                                 }\r
65                                 else\r
66                                         return "Roles not enabled";\r
67                         }\r
68                 }\r
69 \r
70                 protected void HyperLink1_Load (object sender, EventArgs e)\r
71                 {\r
72                         if (!Roles.Enabled)\r
73                                 ((HyperLink) sender).Enabled = false;\r
74                 }\r
75         }\r
76 }\r