<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="addstream.aspx.cs" Inherits="code_addstream" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="sinistra" runat="Server">
    Da questa pagina puoi aggiungere o rimuovere i tuoi datastream.
    <br />
    <asp:Label ID="usersinistra" runat="server" Text="Label" Visible="False"></asp:Label>
    <br />
    <h2>
        I tuoi datastream:</h2>
    <asp:DataList ID="DataList1" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan"
        BorderWidth="1px" CellPadding="2" DataKeyField="id_datastream" DataSourceID="AccessDataSource1"
        ForeColor="Black">
        <AlternatingItemStyle BackColor="PaleGoldenrod" />
        <FooterStyle BackColor="Tan" />
        <HeaderStyle BackColor="Tan" Font-Bold="True" />
        <ItemTemplate>
            ID:
            <asp:Label ID="id_datastreamLabel" runat="server" Text='<%# Eval("id_datastream") %>' />
            <br />
            Descrizione:
            <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
            <br />
            <br />
        </ItemTemplate>
        <SelectedItemStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
    </asp:DataList>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/ASPNetDB.mdb"
        
        SelectCommand="SELECT [reg_time], [id_datastream], [description] FROM [datastreams] WHERE ([user] = ?)">
        <SelectParameters>
            <asp:ControlParameter ControlID="usersinistra" Name="user" PropertyName="Text" 
                Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
    <br />
    <br />
    <div class="menu1">
        <ul>
            <li class="menu-01">
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/code/mypage.aspx">My Page</asp:HyperLink></li>
            <li class="menu-02">
                <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/code/addpoint.aspx">datapoints settings</asp:HyperLink></li>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="destra" runat="Server">

<h2>Add new Datastream </h2>
    <asp:Label ID="userdestra" runat="server" Text="Label" Visible="False"></asp:Label>
<br />
 Descrizione:    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Add" onclick="Button1_Click" />
<br /><br /><br />
<h2>Delete Datastream </h2>
<br />
    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
        DataSourceID="AccessDataSource2" DataTextField="id_datastream" 
        DataValueField="id_datastream">
    </asp:DropDownList>
    <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
        DataFile="~/App_Data/ASPNetDB.mdb" 
        SelectCommand="SELECT [id_datastream] FROM [datastreams] WHERE ([user] = ?)">
        <SelectParameters>
            <asp:ControlParameter ControlID="userdestra" Name="user" PropertyName="Text" 
                Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
    <asp:Button ID="Button2" runat="server" Text="Delete" onclick="Button2_Click" />
        <br />
    <br />
    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/ok.jpg" Visible="False"
        Height="100px" Width="100px" />
    <asp:Image ID="Image2" runat="server" ImageUrl="~/images/no.jpg" Visible="False"
        Height="100px" Width="100px" />
    <br />
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label><br />
    <asp:Label ID="Label2" runat="server" Text=""></asp:Label><br />
    <asp:Label ID="Label3" runat="server" Text=""></asp:Label><br />
    <br />
    <br />
</asp:Content>
