onlineperson.aspx
上传用户:xuming1973
上传日期:2014-02-27
资源大小:17511k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="onlineperson.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.onlineperson" %>
  2. <%@ Import namespace = "System" %>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  4. <HTML>
  5. <HEAD>
  6. <title>在线人员</title>
  7. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  8. <meta content="C#" name="CODE_LANGUAGE">
  9. <meta content="JavaScript" name="vs_defaultClientScript">
  10. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  11. <LINK href="../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  12. <script language="C#" runat="server">
  13. private TimeSpan GetOnlineTime(DateTime logintime,DateTime activetime)
  14. {
  15. return(activetime - logintime);
  16. }
  17. </script>
  18. <script language="javascript">
  19. function SendMsg(username,realname)
  20. {
  21. window.opener.parent.parent.MainFrame.location='../SM/MsgSend.aspx?SendTo='+username+'&SendToRealName='+realname;
  22. window.close();
  23. }
  24. </script>
  25. <LINK href="../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  26. </HEAD>
  27. <body MS_POSITIONING="GridLayout" leftmargin="0" topmargin="0">
  28. <form id="onlineperson" method="post" runat="server">
  29. <FONT face="宋体">
  30. <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
  31. <TR>
  32. <TD background="../../Images/treetopbg.jpg" height="30"><font size="2">在线人数详细</font></TD>
  33. </TR>
  34. <TR>
  35. <TD><asp:datagrid id="dgrd_OnlinePerson" runat="server" Width="100%" AutoGenerateColumns="False" AllowSorting="True"
  36. BorderWidth="1px" BorderStyle="None" BorderColor="#93BEE2" class="gbtext" CellPadding="2">
  37. <HeaderStyle Font-Size="X-Small" Height="24px" BackColor="#E8F4FF"></HeaderStyle>
  38. <Columns>
  39. <asp:TemplateColumn HeaderText="姓名">
  40. <ItemTemplate>
  41. <a href="#" onclick='javascript:SendMsg("<%# DataBinder.Eval(Container, "DataItem.Staff_Name") %>","<%# DataBinder.Eval(Container, "DataItem.realname") %>")'>
  42. <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.realname") %>'>
  43. </asp:Label></a> </asp:Label>
  44. </ItemTemplate>
  45. <EditItemTemplate>
  46. <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.realname") %>'>
  47. </asp:TextBox>
  48. </EditItemTemplate>
  49. </asp:TemplateColumn>
  50. <asp:TemplateColumn SortExpression="LoginTime" HeaderText="登陆时间">
  51. <ItemTemplate>
  52. <asp:Label runat="server" Text='<%# DateTime.Parse(DataBinder.Eval(Container, "DataItem.LoginTime").ToString()).ToShortTimeString() %>'>
  53. </asp:Label>
  54. </ItemTemplate>
  55. </asp:TemplateColumn>
  56. <asp:TemplateColumn HeaderText="在线时间">
  57. <ItemTemplate>
  58. <%#  GetOnlineTime(DateTime.Parse(DataBinder.Eval(Container.DataItem,"LoginTime").ToString()),DateTime.Parse(DataBinder.Eval(Container.DataItem,"ActiveTime").ToString())).ToString()%>
  59. </ItemTemplate>
  60. </asp:TemplateColumn>
  61. <asp:BoundColumn DataField="IpAddr" HeaderText="IP地址"></asp:BoundColumn>
  62. <asp:BoundColumn DataField="Position_Name" SortExpression="Position_Name" HeaderText="职位"></asp:BoundColumn>
  63. <asp:BoundColumn DataField="activeclass" SortExpression="ActiveClass" HeaderText="位置"></asp:BoundColumn>
  64. </Columns>
  65. </asp:datagrid></TD>
  66. </TR>
  67. </TABLE>
  68. </FONT>
  69. </form>
  70. </body>
  71. </HTML>