<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin.aspx.cs" Inherits="ToolsCRM.admin" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Administracja Kontami</title>
    <link rel="stylesheet" href="js/style.css" type="text/css" media="screen" />
    <style type="text/css">
        .Buttonstyle1out
        {
            width: 127px;
	        background: url('../images/button.png') no-repeat left center;
            margin-top: 5px;
            cursor:default;
        }
        .Buttonstyle1hover
        {
            width: 127px;
	        background: url('../images/button.png') no-repeat left center;
            margin-top: 5px;
            cursor:pointer;
        } 
    </style>
</head>
<body>
    <form id="form1" runat="server">
     <div id="header">
	    <div id="logo">
		    <h1><a href="Index.aspx">ToolsCRM</a></h1>
		    <p><a href="http://crm.dynamics.com/pl-pl/home">Microsoft Dynamics CRM</a></p>
	    </div>
         <div id="menu">
		<ul>
			<li class="current_page_item"><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li class="last">
                <div class="post">
                    <p class="links">
                        <asp:Button ID="Wyloguj" runat="server" Text="Wyloguj" CssClass="more" Width="129px" BorderStyle="None" Font-Bold="True" ForeColor="White" OnClick="Wyloguj_Click" onMouseOver="this.className='Buttonstyle1hover'" onMouseOut="this.className='Buttonstyle1out'" />

                 </p>
                </div>
			</li>      
        </ul>
	</div>
     </div>
        <div id="page">
          <div class="post">
            <div id="content">
                <div class="title">
				    <h2><a href="#">Administracja kontami</a></h2>
			    </div>
                <div class="entry">
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="UserId" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Vertical" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
                            <asp:BoundField DataField="UserId" HeaderText="UserId" InsertVisible="False" ReadOnly="True" SortExpression="UserId" />
                            <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />
                            <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" />
                            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                    <br />
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RegConnectionString %>" DeleteCommand="DELETE FROM [Users] WHERE [UserId] = @UserId" InsertCommand="INSERT INTO [Users] ([UserName], [Password], [Email]) VALUES (@UserName, @Password, @Email)" SelectCommand="SELECT * FROM [Users]" UpdateCommand="UPDATE [Users] SET [UserName] = @UserName, [Password] = @Password, [Email] = @Email WHERE [UserId] = @UserId">
                        <DeleteParameters>
                            <asp:Parameter Name="UserId" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="UserName" Type="String" />
                            <asp:Parameter Name="Password" Type="String" />
                            <asp:Parameter Name="Email" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="UserName" Type="String" />
                            <asp:Parameter Name="Password" Type="String" />
                            <asp:Parameter Name="Email" Type="String" />
                            <asp:Parameter Name="UserId" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </div>
             </div>
            </div>
          </div>
    </form>
</body>
</html>
