<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companymanage.aspx.cs" Inherits="FangPage.Admin.companymanage" %>

<%@ Register TagPrefix="cc1" Namespace="FangPage.Control" Assembly="FangPage.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>企业用户管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/bmsmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/common.js"></script>
    <script language="javascript" type="text/javascript">
      function OpenCompanyView(uid){
	        window.showModalDialog("companyview.aspx?uid="+uid,"","dialogWidth:600px;status:no;status:no;dialogHeight:450px;scrollbars:no");
        }
        
       function OpenUserView(uid){
	        window.showModalDialog("userview.aspx?uid="+uid,"","dialogWidth:600px;status:no;status:no;dialogHeight:450px;scrollbars:no");
        }
    </script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5">
    <form id="form1" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left" class="table1">
            <tr>
                <td width="60">&nbsp;
                <input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                        id="chkall" />全选
                </td>
                <td align="left">
                    <cc1:Button ID="DelRec" runat="server" Text=" 删 除" ButtonImgUrl="images/del.gif"
                        OnClick="DelRec_Click"></cc1:Button>
                    <cc1:Button ID="Status" runat="server" Text="通过审核" ButtonImgUrl="images/submit.gif" 
                        onclick="Status_Click"></cc1:Button>&nbsp;
                    <button type="button" class="ManagerButton" onclick="window.location='companysearch.aspx?returnurl=companymanage.aspx';">
                        <img src="images/search.gif" />搜 索</button>
                </td>
            </tr>
        </table>
    </div>
    <cc1:DataGrid ID="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged"
        PageSize="20">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <ItemTemplate>
                    <input id="uid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.uid").ToString() %>"
                        name="uid" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="uid" SortExpression="uid" HeaderText="uid" Visible="false">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderText="用户名">
                <ItemTemplate>
                    <%# RoleStr(DataBinder.Eval(Container, "DataItem.roleid").ToString(), DataBinder.Eval(Container, "DataItem.uid").ToString())%>
                    <a href="javascript:OpenUserView(<%# DataBinder.Eval(Container, "DataItem.uid").ToString() %>)">
                        <%# DataBinder.Eval(Container, "DataItem.username").ToString()%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderText="公司名称">
                <ItemTemplate>
                    <a href="javascript:OpenCompanyView(<%# DataBinder.Eval(Container, "DataItem.uid").ToString() %>)">
                        <%# DataBinder.Eval(Container, "DataItem.companyname").ToString()%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="所属用户组">
                <ItemTemplate>
                    <%# GetGroupName(DataBinder.Eval(Container, "DataItem.groupid").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="createdatetime" HeaderText="注册时间"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="状态">
                <ItemTemplate>
                    <%# StateStr(DataBinder.Eval(Container, "DataItem.state").ToString().Trim())%>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作">
                <ItemTemplate>
                    <a href="companyedit.aspx?uid=<%# DataBinder.Eval(Container, "DataItem.uid").ToString()%>&returnurl=companymanage.aspx">
                        编辑</a>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc1:DataGrid>
    </form>
</body>
</html>
