<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteMenu.Master" AutoEventWireup="true" CodeBehind="BS_Admin.aspx.cs" Inherits="Crm25175.BS_Admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function DoubleAddClick() {
            document.getElementById("ContentPlaceHolder1_BT_Add").click();
        }

        //后台调用,区分提示信息底色
        //Danger,Info
        function ChangeMsgClass(MsgType) {
            if (MsgType == "Danger") {
                DivMsg.className = 'alert alert-danger';
            }
            else {
                DivMsg.className = 'alert alert-info';
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
		</script>
		<ul class="breadcrumb">
			<li>
				<i class="<%=PageIcon %>"></i>
                用户账号维护
			</li>
		</ul>
	</div>

    <div class="page-content">
        <div class="row col-xs-12">
            <div id="DivMsg" class="alert alert-info">
                <i class="icon-hand-right"></i>
                <asp:Label ID="LabMsg" runat="server" Text=" "></asp:Label>
			    <button class="close" data-dismiss="alert">
                <i class="icon-remove"></i>
                </button>
            </div>
        </div>


        <div class="page-header">
            <div class="col-xs-12 widget-box">
                <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="数据列表" CssClass="btn btn-info btn-sm" />
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="添加" CssClass="btn btn-primary btn-sm" />
            </div>
        </div>
        <asp:Panel runat="server" Visible="false" ID="PanelAdd">
            <div class="row clearfix form-actions">
                
                <div class="form-group col-md-offset-2 col-xs-8">
                    <label class="col-sm-3 control-label no-padding-right">用户类别</label>
                    <div class="space-2"></div>
                    <asp:DropDownList ID="DDLAdminType" runat="server" CssClass="col-xs-6">
                        <asp:ListItem Value="admin">管理员</asp:ListItem>
                        <asp:ListItem Value="checker">检查员</asp:ListItem>
                        <asp:ListItem Value="saler">销售员</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="space-4"></div>
	            <div class="form-group col-md-offset-2 col-xs-8" >
					<label class="col-sm-3 control-label no-padding-right">用户账号</label>
                    <div class="space-2"></div>
	                <asp:TextBox runat="server" id="TxtUserID"  CssClass="col-xs-6"/>
                </div>
                <div class="space-4"></div>
                <div class="form-group col-md-offset-2 col-xs-8" >
					<label class="col-sm-3 control-label no-padding-right">姓名</label>
                    <div class="space-2"></div>
	                <asp:TextBox runat="server" id="TxtUserName"  CssClass="col-xs-6"/>
                </div>
                <div class="space-4"></div>
                <div class="form-group col-md-offset-2 col-xs-8" >
					<label class="col-sm-3 control-label no-padding-right">密码</label>
                    <div class="space-2"></div>
	                <asp:TextBox runat="server" id="TxtPassWord" TextMode="Password" CssClass="col-xs-6"/>
                </div>
                <div class="space-4"></div>
                <div class="form-group col-md-offset-2 col-xs-8">
                    <label class="col-sm-3 control-label no-padding-right">状态</label>
                    <div class="space-2"></div>
                    <asp:DropDownList ID="DDLState" runat="server" CssClass="col-xs-2">
                        <asp:ListItem Value="Y"></asp:ListItem>
                        <asp:ListItem Value="N"></asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="space-6"></div>
				<div class="form-group col-xs-12 center">
                    <asp:Button ID="BT_Add" runat="server" Text="确认" 
                            CssClass="btn btn-info icon-ok bigger-110 hidden " OnClick="BT_Add_Click" />
                    <button class="btn btn-info" type="button" onclick="DoubleAddClick()">
						<i class="icon-ok bigger-110"></i>
						确认
					</button>
                    <Button id="Reset1" type="reset" value="取消"  class="btn" ><i class="icon-undo bigger-110"></i>
					    Reset
                    </Button>
                </div>
            </div>
        </asp:Panel>

        <asp:Panel runat="server" Visible="false" ID="PanelData">
            <div class="row">
	            <div class="col-xs-12">
		            <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="False" DataKeyNames="ID" OnRowDataBound="GridView1_RowDataBound" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging">
                            <Columns>
                                <%--<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True"/>--%>
                                <asp:BoundField DataField="UserID" HeaderText="账号" ReadOnly="True" />
                                <asp:BoundField DataField="UserName" HeaderText="姓名" />
                                <%--<asp:BoundField DataField="PassWord" HeaderText="密码" />--%>
                                <asp:TemplateField HeaderText="密码">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TxtPassWord" runat="server" CssClass="col-xs-12" Text="" TextMode="Password"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="LabPassWord" runat="server" Text='<%# Bind("PassWord") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="类别">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DDLAdminType_GV" runat="server" SelectedValue='<%# Bind("AdminType")%>' CssClass ="col-xs-12">
                                            <asp:ListItem Value="admin">管理员</asp:ListItem>
                                            <asp:ListItem Value="checker">检查员</asp:ListItem>
                                            <asp:ListItem Value="saler">销售员</asp:ListItem>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="LbAdminType" runat="server" Text='<%#Bind("AdminTypeName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="角色">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DDLRoleName" runat="server" CssClass="col-xs-12" >
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="LabRoleName" runat="server" Text='<%# Bind("RoleName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="EditDate" HeaderText="维护时间" ReadOnly="True" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" />
                                <asp:TemplateField HeaderText="状态">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="DDLState" runat="server" SelectedValue='<%# Bind("State")%>' CssClass ="col-xs-12">
                                            <asp:ListItem Value="Y"></asp:ListItem>
                                            <asp:ListItem Value="N"></asp:ListItem>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%#Bind("State") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField ShowEditButton="True" >
                                </asp:CommandField>
                                <asp:CommandField ShowDeleteButton="True" />
                            </Columns>
                        </asp:GridView>
		            </div><!-- /.table-responsive -->
	            </div><!-- /span -->
            </div>
        </asp:Panel>

</div>
    
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_Footer" runat="server">

    <script src="../assets/js/jquery-2.0.3.min.js"></script>

	<script type="text/javascript">
		window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
	</script>

	<script type="text/javascript">
		if ("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
	</script>
	<script src="../assets/js/bootstrap.min.js"></script>
	<script src="../assets/js/typeahead-bs2.min.js"></script>

	<!-- page specific plugin scripts -->

	<!-- ace scripts -->

	<script src="../assets/js/ace-elements.min.js"></script>
	<script src="../assets/js/ace.min.js"></script>

</asp:Content>
