Default.aspx
上传用户:zhuzg88
上传日期:2018-04-24
资源大小:868k
文件大小:46k
源码类别:

SilverLight

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Administration_Default" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5.     <title>SilverlightDesktop - Administration</title>
  6.     <style type="text/css">
  7.         .style1
  8.         {
  9.             width: 500px;
  10.         }
  11.         .style2
  12.         {
  13.             width: 20px;
  14.         }
  15.         .style3
  16.         {
  17.             text-align: right;
  18.         }
  19.         .style4
  20.         {
  21.             text-align: right;
  22.             width: 273px;
  23.         }
  24.     </style>
  25. </head>
  26. <body>
  27.     <form id="form1" runat="server">
  28.     <div>
  29.         <img alt="SilverlightDesktop Administration" src="../images/SilverlightDesktop_small.gif"
  30.             style="width: 264px; height: 122px" /></div>
  31.     <h2>
  32.         Administration</h2>
  33.     <p>
  34.         <asp:LinkButton ID="lnkBack" runat="server" PostBackUrl="~/Default.aspx">Back to 
  35.         Main</asp:LinkButton>
  36.     </p>
  37.     <asp:Menu ID="AdministrationMenu" runat="server" BackColor="#E3EAEB" DynamicHorizontalOffset="2"
  38.         Font-Names="Verdana" Font-Size="1.0em" ForeColor="#666666" Orientation="Horizontal"
  39.         StaticSubMenuIndent="10px" OnMenuItemClick="AdministrationMenu_MenuItemClick">
  40.         <StaticSelectedStyle BackColor="Yellow" />
  41.         <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
  42.         <DynamicHoverStyle BackColor="#666666" ForeColor="White" />
  43.         <DynamicMenuStyle BackColor="#E3EAEB" />
  44.         <DynamicSelectedStyle BackColor="#1C5E55" />
  45.         <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
  46.         <StaticHoverStyle BackColor="#666666" ForeColor="White" />
  47.         <Items>
  48.             <asp:MenuItem Text="General Settings" ToolTip="Basic application settings" Value="General Settings">
  49.             </asp:MenuItem>
  50.             <asp:MenuItem Text="User Management" ToolTip="Add delete and edit users" Value="User Management">
  51.             </asp:MenuItem>
  52.             <asp:MenuItem Text="Module Settings" ToolTip="Set security for modules" Value="Module Settings">
  53.             </asp:MenuItem>
  54.             <asp:MenuItem Text="Desktops" ToolTip="Manage SilverlightDesktop instances" Value="Desktops">
  55.             </asp:MenuItem>
  56.             <asp:MenuItem Text="Application Log" ToolTip="Applications events and errors" Value="Application Log">
  57.             </asp:MenuItem>
  58.         </Items>
  59.     </asp:Menu>
  60.     <asp:MultiView ID="mvAdministration" runat="server">
  61.         <asp:View ID="vwGeneralSettings" runat="server">
  62.             <h2>
  63.                 General Settings</h2>
  64.             <table align="left" cellpadding="4" class="style1">
  65.                 <tr>
  66.                     <td class="style4">
  67.                         Version:
  68.                     </td>
  69.                     <td class="style2">
  70.                         &nbsp;
  71.                     </td>
  72.                     <td>
  73.                         <asp:Label ID="lblVersion" runat="server"></asp:Label>
  74.                     </td>
  75.                 </tr>
  76.                 <tr>
  77.                     <td class="style4">
  78.                         Allow anonymous users:
  79.                     </td>
  80.                     <td class="style2">
  81.                         &nbsp;
  82.                     </td>
  83.                     <td>
  84.                         <asp:DropDownList ID="ddlAnonymousLogin" runat="server">
  85.                             <asp:ListItem>True</asp:ListItem>
  86.                             <asp:ListItem>False</asp:ListItem>
  87.                         </asp:DropDownList>
  88.                     </td>
  89.                 </tr>
  90.                 <tr>
  91.                     <td class="style4">
  92.                         Maximum password attempts:
  93.                     </td>
  94.                     <td class="style2">
  95.                         &nbsp;
  96.                     </td>
  97.                     <td>
  98.                         <asp:TextBox ID="txtMaxPasswordAttempts" runat="server" Columns="3" MaxLength="8"></asp:TextBox>
  99.                         <asp:RequiredFieldValidator ID="vMaximumPasswordAttempts" runat="server" ControlToValidate="txtMaxPasswordAttempts"
  100.                             ErrorMessage="Maxium password attempts must have a value">*</asp:RequiredFieldValidator>
  101.                         <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtMaxPasswordAttempts"
  102.                             ErrorMessage="Maxium password attempts must be a number" MaximumValue="999999"
  103.                             MinimumValue="0" Type="Integer">*</asp:RangeValidator>
  104.                     </td>
  105.                 </tr>
  106.                 <tr>
  107.                     <td class="style4">
  108.                         &nbsp;
  109.                     </td>
  110.                     <td class="style2">
  111.                         &nbsp;
  112.                     </td>
  113.                     <td>
  114.                         &nbsp;
  115.                     </td>
  116.                 </tr>
  117.                 <tr>
  118.                     <td class="style4">
  119.                         SMTP Server and port:
  120.                     </td>
  121.                     <td class="style2">
  122.                         &nbsp;
  123.                     </td>
  124.                     <td>
  125.                         <asp:TextBox ID="txtSMTPEmailServer" runat="server" MaxLength="50"></asp:TextBox>
  126.                     </td>
  127.                 </tr>
  128.                 <tr>
  129.                     <td class="style4">
  130.                         SMTP Authendication:
  131.                     </td>
  132.                     <td class="style2">
  133.                         &nbsp;
  134.                     </td>
  135.                     <td>
  136.                         <asp:RadioButtonList ID="rbAuthendication" runat="server" RepeatDirection="Horizontal">
  137.                             <asp:ListItem Selected="True" Value="0">Anonymous</asp:ListItem>
  138.                             <asp:ListItem Value="1">Basic</asp:ListItem>
  139.                             <asp:ListItem Value="2">NTLM</asp:ListItem>
  140.                         </asp:RadioButtonList>
  141.                     </td>
  142.                 </tr>
  143.                 <tr>
  144.                     <td class="style4">
  145.                         Use secure SMTP access:
  146.                     </td>
  147.                     <td class="style2">
  148.                         &nbsp;
  149.                     </td>
  150.                     <td>
  151.                         <asp:CheckBox ID="chkSecureAccess" runat="server" />
  152.                     </td>
  153.                 </tr>
  154.                 <tr>
  155.                     <td class="style4">
  156.                         SMTP Username:
  157.                     </td>
  158.                     <td class="style2">
  159.                         &nbsp;
  160.                     </td>
  161.                     <td>
  162.                         <asp:TextBox ID="txtSMTPUsername" runat="server" MaxLength="50"></asp:TextBox>
  163.                     </td>
  164.                 </tr>
  165.                 <tr>
  166.                     <td class="style4">
  167.                         SMTP Password:
  168.                     </td>
  169.                     <td class="style2">
  170.                         &nbsp;
  171.                     </td>
  172.                     <td>
  173.                         <asp:TextBox ID="txtSMTPPassword" runat="server" MaxLength="50"></asp:TextBox>
  174.                     </td>
  175.                 </tr>
  176.                 <tr>
  177.                     <td class="style4">
  178.                         SMTP &quot;From&quot; email address:
  179.                     </td>
  180.                     <td class="style2">
  181.                         &nbsp;
  182.                     </td>
  183.                     <td>
  184.                         <asp:TextBox ID="txtSMTPFrom" runat="server" Columns="40" MaxLength="50"></asp:TextBox>
  185.                     </td>
  186.                 </tr>
  187.                 <tr>
  188.                     <td class="style4">
  189.                         &nbsp;
  190.                     </td>
  191.                     <td class="style2">
  192.                         &nbsp;
  193.                     </td>
  194.                     <td>
  195.                         <asp:LinkButton ID="lnkTestEmail" runat="server" OnClick="lnkTestEmail_Click" ToolTip="This uses the settings on the form right now, not the last saved settings.">[Send 
  196.                         Test Email]</asp:LinkButton>
  197.                     </td>
  198.                 </tr>
  199.                 <tr>
  200.                     <td class="style4">
  201.                         &nbsp;
  202.                     </td>
  203.                     <td class="style2">
  204.                         &nbsp;
  205.                     </td>
  206.                     <td>
  207.                     </td>
  208.                 </tr>
  209.                 <tr>
  210.                     <td class="style3" colspan="3">
  211.                         <asp:ValidationSummary ID="VSummary" runat="server" />
  212.                     </td>
  213.                 </tr>
  214.                 <tr>
  215.                     <td class="style4">
  216.                         <asp:Label ID="lblUpdated" runat="server" EnableViewState="False" ForeColor="Blue"></asp:Label>
  217.                     </td>
  218.                     <td class="style2">
  219.                         &nbsp;
  220.                     </td>
  221.                     <td>
  222.                         <asp:Button ID="btnUpdateSettings" runat="server" OnClick="btnUpdateSettings_Click"
  223.                             Text="Update Settings" />
  224.                     </td>
  225.                 </tr>
  226.             </table>
  227.         </asp:View>
  228.         <asp:View ID="vwUserManagement" runat="server">
  229.             <h2>
  230.                 User Management</h2>
  231.             <p>
  232.                 <asp:ListView ID="lvUsers" runat="server" DataKeyNames="UserID" DataSourceID="LDSUsers"
  233.                     InsertItemPosition="LastItem" OnItemInserted="lvUsers_ItemInserted" OnItemUpdated="lvUsers_ItemUpdated">
  234.                     <LayoutTemplate>
  235.                         <table id="Table1" runat="server">
  236.                             <tr id="Tr1" runat="server">
  237.                                 <td id="Td1" runat="server">
  238.                                     <table id="itemPlaceholderContainer" runat="server" border="0" style="">
  239.                                         <tr id="Tr2" runat="server" style="">
  240.                                             <th id="Th1" runat="server">
  241.                                             </th>
  242.                                             <th id="Th2" runat="server">
  243.                                                 UserID
  244.                                             </th>
  245.                                             <th id="Th3" runat="server">
  246.                                                 User Name
  247.                                             </th>
  248.                                             <th id="Th4" runat="server">
  249.                                                 Password
  250.                                             </th>
  251.                                             <th id="Th5" runat="server">
  252.                                                 First Name
  253.                                             </th>
  254.                                             <th id="Th6" runat="server">
  255.                                                 Last Name
  256.                                             </th>
  257.                                             <th id="Th7" runat="server">
  258.                                                 Email
  259.                                             </th>
  260.                                             <th id="Th8" runat="server">
  261.                                                 Role
  262.                                             </th>
  263.                                             <th id="Th9" runat="server">
  264.                                                 Active
  265.                                             </th>
  266.                                             <th id="Th10" runat="server">
  267.                                                 SuperUser
  268.                                             </th>
  269.                                         </tr>
  270.                                         <tr id="itemPlaceholder" runat="server">
  271.                                         </tr>
  272.                                     </table>
  273.                                 </td>
  274.                             </tr>
  275.                             <tr id="Tr3" runat="server">
  276.                                 <td id="Td2" runat="server" style="">
  277.                                     <asp:DataPager ID="DataPager1" runat="server">
  278.                                         <Fields>
  279.                                             <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
  280.                                                 ShowPreviousPageButton="False" />
  281.                                             <asp:NumericPagerField />
  282.                                             <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
  283.                                                 ShowPreviousPageButton="False" />
  284.                                         </Fields>
  285.                                     </asp:DataPager>
  286.                                 </td>
  287.                             </tr>
  288.                         </table>
  289.                     </LayoutTemplate>
  290.                     <InsertItemTemplate>
  291.                         <tr style="">
  292.                             <td>
  293.                                 <br />
  294.                                 <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" ValidationGroup="Insert" /><br />
  295.                                 <br />
  296.                             </td>
  297.                             <td>
  298.                                 &nbsp;
  299.                             </td>
  300.                             <td>
  301.                                 <br />
  302.                                 <asp:TextBox ID="UserNameTextBox" runat="server" Text='<%# Bind("UserName") %>' MaxLength="50"
  303.                                     ValidationGroup="Insert" /><br />
  304.                                 <asp:RequiredFieldValidator ID="valUserName" runat="server" ErrorMessage="User Name is required"
  305.                                     ControlToValidate="UserNameTextBox" ValidationGroup="Insert"></asp:RequiredFieldValidator>
  306.                             </td>
  307.                             <td>
  308.                                 <br />
  309.                                 <asp:TextBox ID="PasswordTextBox" runat="server" Text='<%# Bind("Password") %>' MaxLength="50"
  310.                                     TextMode="Password" ValidationGroup="Insert" /><br />
  311.                                 <asp:RequiredFieldValidator ID="valPassword" runat="server" ErrorMessage="Password is required"
  312.                                     ControlToValidate="PasswordTextBox" ValidationGroup="Insert"></asp:RequiredFieldValidator>
  313.                             </td>
  314.                             <td>
  315.                                 <br />
  316.                                 <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>'
  317.                                     MaxLength="50" /><br />
  318.                                 <br />
  319.                             </td>
  320.                             <td>
  321.                                 <br />
  322.                                 <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>' MaxLength="50" /><br />
  323.                                 <br />
  324.                             </td>
  325.                             <td>
  326.                                 <br />
  327.                                 <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' MaxLength="50" /><br />
  328.                                 <br />
  329.                             </td>
  330.                             <td>
  331.                                 <br />
  332.                                 <asp:DropDownList ID="ddlRoles" runat="server" SelectedValue='<%# Bind("Role") %>'>
  333.                                     <asp:ListItem>Administrators</asp:ListItem>
  334.                                     <asp:ListItem Selected="True">Users</asp:ListItem>
  335.                                 </asp:DropDownList>
  336.                                 <br />
  337.                                 <br />
  338.                             </td>
  339.                             <td>
  340.                                 <br />
  341.                                 <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>' /><br />
  342.                                 <br />
  343.                             </td>
  344.                             <td>
  345.                                 <br />
  346.                                 <asp:CheckBox ID="SuperUserCheckBox" runat="server" Checked='<%# Bind("SuperUser") %>' /><br />
  347.                                 <br />
  348.                             </td>
  349.                         </tr>
  350.                     </InsertItemTemplate>
  351.                     <EmptyDataTemplate>
  352.                         <table id="Table2" runat="server" style="">
  353.                             <tr>
  354.                                 <td>
  355.                                     No data was returned.
  356.                                 </td>
  357.                             </tr>
  358.                         </table>
  359.                     </EmptyDataTemplate>
  360.                     <EditItemTemplate>
  361.                         <tr style="">
  362.                             <td>
  363.                                 <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" ValidationGroup="Edit" />
  364.                                 <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="False" /><br />
  365.                                 <br />
  366.                             </td>
  367.                             <td>
  368.                                 <asp:Label ID="UserIDLabel1" runat="server" Text='<%# Eval("UserID") %>' /><br />
  369.                                 <br />
  370.                             </td>
  371.                             <td>
  372.                                 <asp:Label ID="lblUserName" runat="server" Text='<%# Eval("UserName") %>' /><br />
  373.                                 <br />
  374.                             </td>
  375.                             <td>
  376.                                 <asp:TextBox ID="PasswordTextBox" runat="server" Text='<%# Bind("Password") %>' MaxLength="50" /><br />
  377.                                 <asp:RequiredFieldValidator ID="valPassword" runat="server" ErrorMessage="Password is required"
  378.                                     ControlToValidate="PasswordTextBox" ValidationGroup="Edit"></asp:RequiredFieldValidator>
  379.                             </td>
  380.                             <td>
  381.                                 <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>'
  382.                                     MaxLength="50" /><br />
  383.                                 <br />
  384.                             </td>
  385.                             <td>
  386.                                 <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>' MaxLength="50" /><br />
  387.                                 <br />
  388.                             </td>
  389.                             <td>
  390.                                 <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' MaxLength="50"
  391.                                     Columns="40" /><br />
  392.                                 <br />
  393.                             </td>
  394.                             <td>
  395.                                 <asp:DropDownList ID="ddlRoles" runat="server" SelectedValue='<%# Bind("Role") %>'>
  396.                                     <asp:ListItem>Administrators</asp:ListItem>
  397.                                     <asp:ListItem>Users</asp:ListItem>
  398.                                 </asp:DropDownList>
  399.                                 <br />
  400.                                 <br />
  401.                             </td>
  402.                             <td>
  403.                                 <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Bind("Active") %>' /><br />
  404.                                 <br />
  405.                             </td>
  406.                             <td>
  407.                                 <asp:CheckBox ID="SuperUserCheckBox" runat="server" Checked='<%# Bind("SuperUser") %>' /><br />
  408.                                 <br />
  409.                             </td>
  410.                         </tr>
  411.                     </EditItemTemplate>
  412.                     <ItemTemplate>
  413.                         <tr style="">
  414.                             <td>
  415.                                 <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are you certain you want to delete ?');" />
  416.                                 <asp:Button ID="EditButton" CausesValidation="False" runat="server" CommandName="Edit"
  417.                                     Text="Edit" />
  418.                             </td>
  419.                             <td>
  420.                                 <asp:Label ID="UserIDLabel" runat="server" Text='<%# Eval("UserID") %>' />
  421.                             </td>
  422.                             <td>
  423.                                 <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
  424.                             </td>
  425.                             <td>
  426.                                 <asp:Label ID="PasswordLabel" runat="server" Text='*******' />
  427.                             </td>
  428.                             <td>
  429.                                 <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' />
  430.                             </td>
  431.                             <td>
  432.                                 <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' />
  433.                             </td>
  434.                             <td>
  435.                                 <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
  436.                             </td>
  437.                             <td>
  438.                                 <asp:Label ID="txtRole" runat="server" Text='<%# Eval("Role") %>' />
  439.                             </td>
  440.                             <td>
  441.                                 <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Eval("Active") %>'
  442.                                     Enabled="false" />
  443.                             </td>
  444.                             <td>
  445.                                 <asp:CheckBox ID="SuperUserCheckBox" runat="server" Checked='<%# Eval("SuperUser") %>'
  446.                                     Enabled="false" />
  447.                             </td>
  448.                         </tr>
  449.                     </ItemTemplate>
  450.                 </asp:ListView>
  451.             </p>
  452.             <p>
  453.                 <asp:Label ID="lblError" runat="server" EnableViewState="False" Font-Bold="True"
  454.                     ForeColor="Red"></asp:Label>
  455.             </p>
  456.         </asp:View>
  457.         <asp:View ID="vwModuleSettings" runat="server">
  458.             <h2>
  459.                 Module Settings</h2>
  460.             <asp:Panel ID="pnlInsertDesktop" runat="server">
  461.             </asp:Panel>
  462.             <p>
  463.                 <asp:ListView ID="ListView1" runat="server" DataKeyNames="ModuleID" DataSourceID="LDSModuleSettings"
  464.                     InsertItemPosition="LastItem" OnItemInserted="ListView1_ItemInserted" OnItemDeleting="ListView1_ItemDeleting">
  465.                     <LayoutTemplate>
  466.                         <table runat="server">
  467.                             <tr runat="server">
  468.                                 <td runat="server">
  469.                                     <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
  470.                                         border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
  471.                                         font-family: Verdana, Arial, Helvetica, sans-serif;">
  472.                                         <tr runat="server" style="background-color: #E0FFFF; color: #333333;">
  473.                                             <th runat="server">
  474.                                             </th>
  475.                                             <th runat="server">
  476.                                                 Name
  477.                                             </th>
  478.                                             <th runat="server">
  479.                                                 Description
  480.                                             </th>
  481.                                             <th runat="server">
  482.                                                 Assembly
  483.                                             </th>
  484.                                             <th runat="server">
  485.                                                 Class
  486.                                             </th>
  487.                                             <th runat="server">
  488.                                                 Icon
  489.                                             </th>
  490.                                             <th runat="server">
  491.                                                 Role
  492.                                             </th>
  493.                                             <th runat="server">
  494.                                                 WindowSize
  495.                                             </th>
  496.                                             <th runat="server">
  497.                                                 Multiple?
  498.                                             </th>
  499.                                             <th runat="server">
  500.                                                 Version
  501.                                             </th>
  502.                                         </tr>
  503.                                         <tr id="itemPlaceholder" runat="server">
  504.                                         </tr>
  505.                                     </table>
  506.                                 </td>
  507.                             </tr>
  508.                             <tr runat="server">
  509.                                 <td runat="server" style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif;
  510.                                     color: #FFFFFF">
  511.                                     <asp:DataPager ID="DataPager1" runat="server">
  512.                                         <Fields>
  513.                                             <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
  514.                                         </Fields>
  515.                                     </asp:DataPager>
  516.                                 </td>
  517.                             </tr>
  518.                         </table>
  519.                     </LayoutTemplate>
  520.                     <InsertItemTemplate>
  521.                         <tr style="">
  522.                             <td>
  523.                                 <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
  524.                                 <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
  525.                             </td>
  526.                             <td>
  527.                                 <asp:TextBox ID="ModuleNameTextBox" runat="server" Text='<%# Bind("ModuleName") %>' />
  528.                             </td>
  529.                             <td>
  530.                                 <asp:TextBox ID="ModuleDescriptionTextBox" runat="server" Text='<%# Bind("ModuleDescription") %>'
  531.                                     TextMode="MultiLine" Rows="1" Columns="20" />
  532.                             </td>
  533.                             <td>
  534.                                 <asp:TextBox ID="AssemblyNameTextBox" runat="server" Text='<%# Bind("AssemblyName") %>' />
  535.                             </td>
  536.                             <td>
  537.                                 <asp:TextBox ID="ClassNameTextBox" runat="server" Text='<%# Bind("ClassName") %>' />
  538.                             </td>
  539.                             <td>
  540.                                 <asp:TextBox ID="IconNameTextBox" runat="server" Text='<%# Bind("IconName") %>' Columns="8" />
  541.                             </td>
  542.                             <td>
  543.                                 <asp:DropDownList ID="ddlRoles" runat="server" SelectedValue='<%# Bind("Role") %>'>
  544.                                     <asp:ListItem>Any</asp:ListItem>
  545.                                     <asp:ListItem>Administrators</asp:ListItem>
  546.                                     <asp:ListItem>Users</asp:ListItem>
  547.                                 </asp:DropDownList>
  548.                             </td>
  549.                             <td>
  550.                                 <asp:TextBox ID="WindowSizeTextBox" runat="server" Text='<%# Bind("WindowSize") %>'
  551.                                     Columns="2" />
  552.                             </td>
  553.                             <td>
  554.                                 <asp:CheckBox ID="AllowMultipleInstancesCheckBox" runat="server" Checked='<%# Bind("AllowMultipleInstances") %>' />
  555.                             </td>
  556.                             <td>
  557.                                 <asp:TextBox ID="ModuleVersionTextBox" runat="server" Text='<%# Bind("ModuleVersion") %>'
  558.                                     Columns="2" /><asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Bind("uninstall") %>' />
  559.                             </td>
  560.                         </tr>
  561.                     </InsertItemTemplate>
  562.                     <SelectedItemTemplate>
  563.                         <tr style="font-weight: bold; color: #333333;">
  564.                             <td>
  565.                                 <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
  566.                                 <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
  567.                             </td>
  568.                             <td>
  569.                                 <asp:Label ID="ModuleNameLabel" runat="server" Text='<%# Eval("ModuleName") %>' />
  570.                             </td>
  571.                             <td>
  572.                                 <asp:Label ID="ModuleDescriptionLabel" runat="server" Text='<%# Eval("ModuleDescription") %>' />
  573.                             </td>
  574.                             <td>
  575.                                 <asp:Label ID="AssemblyNameLabel" runat="server" Text='<%# Eval("AssemblyName") %>' />
  576.                             </td>
  577.                             <td>
  578.                                 <asp:Label ID="ClassNameLabel" runat="server" Text='<%# Eval("ClassName") %>' />
  579.                             </td>
  580.                             <td>
  581.                                 <asp:Label ID="IconNameLabel" runat="server" Text='<%# Eval("IconName") %>' />
  582.                             </td>
  583.                             <td>
  584.                                 <asp:Label ID="RoleLabel" runat="server" Text='<%# Eval("Role") %>' />
  585.                             </td>
  586.                             <td>
  587.                                 <asp:Label ID="WindowSizeLabel" runat="server" Text='<%# Eval("WindowSize") %>' Columns="2" />
  588.                             </td>
  589.                             <td>
  590.                                 <asp:CheckBox ID="AllowMultipleInstancesCheckBox" runat="server" Checked='<%# Eval("AllowMultipleInstances") %>'
  591.                                     Enabled="false" />
  592.                             </td>
  593.                             <td>
  594.                                 <asp:Label ID="ModuleVersionLabel" runat="server" Text='<%# Eval("ModuleVersion") %>'
  595.                                     Columns="2" />
  596.                             </td>
  597.                         </tr>
  598.                     </SelectedItemTemplate>
  599.                     <EmptyDataTemplate>
  600.                         <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
  601.                             border-color: #999999; border-style: none; border-width: 1px;">
  602.                             <tr>
  603.                                 <td>
  604.                                     There are no modules installed.
  605.                                 </td>
  606.                             </tr>
  607.                         </table>
  608.                     </EmptyDataTemplate>
  609.                     <EditItemTemplate>
  610.                         <tr>
  611.                             <td>
  612.                                 <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
  613.                                 <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
  614.                             </td>
  615.                             <td>
  616.                                 <asp:TextBox ID="ModuleNameTextBox" runat="server" Text='<%# Bind("ModuleName") %>' />
  617.                             </td>
  618.                             <td>
  619.                                 <asp:TextBox ID="ModuleDescriptionTextBox" runat="server" Text='<%# Bind("ModuleDescription") %>'
  620.                                     TextMode="MultiLine" Rows="1" Columns="20" />
  621.                             </td>
  622.                             <td>
  623.                                 <asp:TextBox ID="AssemblyNameTextBox" runat="server" Text='<%# Bind("AssemblyName") %>' />
  624.                             </td>
  625.                             <td>
  626.                                 <asp:TextBox ID="ClassNameTextBox" runat="server" Text='<%# Bind("ClassName") %>' />
  627.                             </td>
  628.                             <td>
  629.                                 <asp:TextBox ID="IconNameTextBox" runat="server" Text='<%# Bind("IconName") %>' Columns="8" />
  630.                             </td>
  631.                             <td>
  632.                                 <asp:DropDownList ID="ddlRoles" runat="server" SelectedValue='<%# Bind("Role") %>'>
  633.                                     <asp:ListItem>Any</asp:ListItem>
  634.                                     <asp:ListItem>Administrators</asp:ListItem>
  635.                                     <asp:ListItem>Users</asp:ListItem>
  636.                                 </asp:DropDownList>
  637.                             </td>
  638.                             <td>
  639.                                 <asp:TextBox ID="WindowSizeTextBox" runat="server" Text='<%# Bind("WindowSize") %>'
  640.                                     Columns="2" />
  641.                             </td>
  642.                             <td>
  643.                                 <asp:CheckBox ID="AllowMultipleInstancesCheckBox" runat="server" Checked='<%# Bind("AllowMultipleInstances") %>' />
  644.                             </td>
  645.                             <td>
  646.                                 <asp:TextBox ID="ModuleVersionTextBox" runat="server" Text='<%# Bind("ModuleVersion") %>'
  647.                                     Columns="2" /><asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Bind("uninstall") %>' />
  648.                             </td>
  649.                         </tr>
  650.                     </EditItemTemplate>
  651.                     <ItemTemplate>
  652.                         <tr style="color: #333333;">
  653.                             <td>
  654.                                 <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are you certain you want to delete ?'); " />
  655.                                 <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
  656.                             </td>
  657.                             <td>
  658.                                 <asp:Label ID="ModuleNameLabel" runat="server" Text='<%# Eval("ModuleName") %>' />
  659.                             </td>
  660.                             <td>
  661.                                 <asp:Label ID="ModuleDescriptionLabel" runat="server" Text='<%# Eval("ModuleDescription") %>' />
  662.                             </td>
  663.                             <td>
  664.                                 <asp:Label ID="AssemblyNameLabel" runat="server" Text='<%# Eval("AssemblyName") %>' />
  665.                             </td>
  666.                             <td>
  667.                                 <asp:Label ID="ClassNameLabel" runat="server" Text='<%# Eval("ClassName") %>' />
  668.                             </td>
  669.                             <td>
  670.                                 <asp:Label ID="IconNameLabel" runat="server" Text='<%# Eval("IconName") %>' />
  671.                             </td>
  672.                             <td>
  673.                                 <asp:Label ID="RoleLabel" runat="server" Text='<%# Eval("Role") %>' />
  674.                             </td>
  675.                             <td>
  676.                                 <asp:Label ID="WindowSizeLabel" runat="server" Text='<%# Eval("WindowSize") %>' />
  677.                             </td>
  678.                             <td>
  679.                                 <asp:CheckBox ID="AllowMultipleInstancesCheckBox" runat="server" Checked='<%# Eval("AllowMultipleInstances") %>'
  680.                                     Enabled="false" />
  681.                             </td>
  682.                             <td>
  683.                                 <asp:Label ID="ModuleVersionLabel" runat="server" Text='<%# Eval("ModuleVersion") %>' />
  684.                             </td>
  685.                         </tr>
  686.                     </ItemTemplate>
  687.                 </asp:ListView>
  688.             </p>
  689.             <p>
  690.                 Upload New Module</p>
  691.             <p>
  692.                 <input type="file" runat="server" id="File1" />
  693.                 <asp:Button runat="server" ID="btnUpload" OnClick="btnUpload_Click" Text="Upload" />
  694.             </p>
  695.             <p>
  696.                 <asp:Label ID="lblModuleError" runat="server" EnableViewState="False" ForeColor="#FF3300"></asp:Label>
  697.             </p>
  698.         </asp:View>
  699.         <asp:View ID="vwDesktops" runat="server">
  700.             <h2>
  701.                 Desktops</h2>
  702.             <asp:Panel ID="pnlSelectDesktop" runat="server">
  703.                 <asp:LinkButton ID="lnkNewDesktop" runat="server" OnClick="lnkNewDesktop_Click">[Create New Desktop Instance]</asp:LinkButton>
  704.                 <br />
  705.                 <br />
  706.                 <asp:Label ID="lblSelectDesktop" runat="server" Text="Select Desktop: "></asp:Label>
  707.                 <asp:DropDownList ID="ddlDesktopInstances" runat="server" AutoPostBack="True" 
  708.                     DataTextField="DesktopName" DataValueField="ID" 
  709.                     OnSelectedIndexChanged="ddlDesktopInstances_SelectedIndexChanged">
  710.                 </asp:DropDownList>
  711.                 <br />
  712.                 <br />
  713.             </asp:Panel>
  714.             <table align="left">
  715.                 <tr>
  716.                     <td nowrap="nowrap">
  717.                         Desktop Name:
  718.                     </td>
  719.                     <td>
  720.                         &nbsp;
  721.                     </td>
  722.                     <td>
  723.                         <asp:TextBox ID="DesktopNameTextBox" runat="server" Columns="40" MaxLength="50" 
  724.                             Text='<%# Bind("DesktopName") %>' />
  725.                     </td>
  726.                 </tr>
  727.                 <tr>
  728.                     <td nowrap="nowrap">
  729.                         Horizontal:
  730.                     </td>
  731.                     <td>
  732.                         &nbsp;
  733.                     </td>
  734.                     <td>
  735.                         <asp:TextBox ID="DesktopSizeHorizontalTextBox" runat="server" Columns="1" 
  736.                             MaxLength="5" Text='<%# Bind("DesktopSizeHorizontal") %>' />
  737.                     </td>
  738.                 </tr>
  739.                 <tr>
  740.                     <td nowrap="nowrap">
  741.                         Vertical:
  742.                     </td>
  743.                     <td>
  744.                         &nbsp;
  745.                     </td>
  746.                     <td>
  747.                         <asp:TextBox ID="DesktopSizeVerticalTextBox" runat="server" Columns="1" 
  748.                             MaxLength="5" Text='<%# Bind("DesktopSizeVertical") %>' />
  749.                     </td>
  750.                 </tr>
  751.                 <tr>
  752.                     <td nowrap="nowrap">
  753.                         Transparent:
  754.                     </td>
  755.                     <td>
  756.                         &nbsp;
  757.                     </td>
  758.                     <td>
  759.                         <asp:CheckBox ID="TransparentCheckBox" runat="server" 
  760.                             Checked='<%# Bind("Transparent") %>' />
  761.                     </td>
  762.                 </tr>
  763.                 <tr>
  764.                     <td nowrap="nowrap">
  765.                         &nbsp;
  766.                     </td>
  767.                     <td>
  768.                         &nbsp;
  769.                     </td>
  770.                     <td>
  771.                         &nbsp;
  772.                     </td>
  773.                 </tr>
  774.                 <tr>
  775.                     <td nowrap="nowrap">
  776.                         AutoLoad Module:
  777.                     </td>
  778.                     <td>
  779.                         &nbsp;
  780.                     </td>
  781.                     <td>
  782.                         <asp:DropDownList ID="ddlAutoLoadModule" runat="server" 
  783.                             DataTextField="ModuleName" DataValueField="ModuleID">
  784.                         </asp:DropDownList>
  785.                     </td>
  786.                 </tr>
  787.                 <tr>
  788.                     <td nowrap="nowrap">
  789.                         <asp:Label ID="lblInstanceUpdated" runat="server" EnableViewState="False" 
  790.                             ForeColor="#FF3300" Text="Updated" Visible="False"></asp:Label>
  791.                     </td>
  792.                     <td>
  793.                         &nbsp;
  794.                     </td>
  795.                     <td align="right">
  796.                         &nbsp;
  797.                     </td>
  798.                 </tr>
  799.                 <tr>
  800.                     <td colspan="3" nowrap="nowrap">
  801.                         <asp:Button ID="btnSaveDesktopInstance" runat="server" 
  802.                             OnClick="btnSaveDesktopInstance_Click" Text="Save" />
  803.                         &nbsp;
  804.                         <asp:Button ID="btnDeleteInstance" runat="server" 
  805.                             onclick="btnDeleteInstance_Click" 
  806.                             onclientclick="return confirm('Are you certain you want to delete ?');" 
  807.                             Text="Delete" />
  808.                         <asp:Button ID="btnCancelDesktopInstance" runat="server" 
  809.                             onclick="btnCancelDesktopInstance_Click" Text="Cancel" />
  810.                     </td>
  811.                 </tr>
  812.             </table>
  813.         </asp:View>
  814.         <asp:View ID="vwApplicationLog" runat="server">
  815.             <h2>
  816.                 Application Log
  817.             </h2>
  818.             <p>
  819.                 <asp:LinkButton ID="lnkRefresh" runat="server" OnClick="lnkRefresh_Click">[Refresh]</asp:LinkButton>
  820.             </p>
  821.             <p>
  822.                 <asp:GridView ID="gvApplicationLog" runat="server" AllowPaging="True" AllowSorting="True"
  823.                     AutoGenerateColumns="False" CellPadding="4" DataKeyNames="LogID" DataSourceID="LDSApplicationLog"
  824.                     ForeColor="#333333" GridLines="None" Width="100%">
  825.                     <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  826.                     <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
  827.                     <Columns>
  828.                         <asp:BoundField DataField="LogID" HeaderText="LogID" InsertVisible="False" ReadOnly="True"
  829.                             SortExpression="LogID" />
  830.                         <asp:BoundField DataField="UserName" HeaderText="User Name" SortExpression="UserName" />
  831.                         <asp:BoundField DataField="LogDescription" HeaderText="Description" SortExpression="LogDescription" />
  832.                         <asp:BoundField DataField="LogDate" HeaderText="Date" SortExpression="LogDate" />
  833.                     </Columns>
  834.                     <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  835.                     <EmptyDataTemplate>
  836.                         No Log Data
  837.                     </EmptyDataTemplate>
  838.                     <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
  839.                     <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  840.                     <EditRowStyle BackColor="#999999" />
  841.                     <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
  842.                 </asp:GridView>
  843.             </p>
  844.         </asp:View>
  845.     </asp:MultiView>
  846.     <asp:LinqDataSource ID="LDSApplicationLog" runat="server" ContextTypeName="SilverlightDesktopCore.DAL.SilverlightDesktopDAL"
  847.         OrderBy="LogDate desc" TableName="SilverlightDesktopLogs">
  848.     </asp:LinqDataSource>
  849.     <asp:LinqDataSource ID="LDSUsers" runat="server" ContextTypeName="SilverlightDesktopCore.DAL.SilverlightDesktopDAL"
  850.         EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="SilverlightDesktopUsers">
  851.     </asp:LinqDataSource>
  852.     <asp:LinqDataSource ID="LDSModuleSettings" runat="server" ContextTypeName="SilverlightDesktopCore.DAL.SilverlightDesktopDAL"
  853.         EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="ModuleName"
  854.         TableName="SilverlightDesktopModules">
  855.     </asp:LinqDataSource>
  856.     <asp:LinqDataSource ID="LDSDesktopInstancs" runat="server" ContextTypeName="SilverlightDesktopCore.DAL.SilverlightDesktopDAL"
  857.         OrderBy="DesktopName" TableName="SilverlightDesktopInstances">
  858.     </asp:LinqDataSource>
  859.     <asp:LinqDataSource ID="LDSDesktopInstance" runat="server" ContextTypeName="SilverlightDesktopCore.DAL.SilverlightDesktopDAL"
  860.         EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="SilverlightDesktopInstances"
  861.         Where="ID == @ID">
  862.         <WhereParameters>
  863.             <asp:ControlParameter ControlID="ddlDesktopInstances" Name="ID" PropertyName="SelectedValue"
  864.                 Type="Int32" />
  865.         </WhereParameters>
  866.     </asp:LinqDataSource>
  867.     </form>
  868. </body>
  869. </html>