<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Resultat_Upload.aspx.cs" Inherits="QW2021C.Resultate.Resultat_Upload" %>

<%@ Register Assembly="Syncfusion.EJ.Web, Version=18.3460.0.35, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>
<%@ Register Assembly="Syncfusion.EJ, Version=18.3460.0.35, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Models" TagPrefix="ej" %>
<%@ Register assembly="Syncfusion.EJ.Web" namespace="Syncfusion.JavaScript.Web" tagprefix="ej" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:Label runat="server"><h4>Upload Resultate</h4></asp:Label>
    <br />

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:QWToolConnectionstring %>"
        SelectCommand="SELECT [OrtNr], [Ort] FROM [Res_Ort]"></asp:SqlDataSource>
    <asp:HiddenField ID="hiddendeletedata" runat="server" Value="false" />
    <asp:HiddenField ID="hiddenortname" runat="server" Value="" />
    <asp:HiddenField ID="hiddenortnr" runat="server" Value="0" />
    <asp:HiddenField ID="hiddenfilename" runat="server" />
    <ej:Tab ID="Tab1" runat="server" ClientSideOnBeforeActive="beforeItemActive">
        <Items>
            <ej:TabItem ID="TabItem1" runat="server" Text="Hochladen">

                <ContentSection>
                    <div class="tab-title">
                        <h4>Ortauswahl</h4>
                        <br />
                    </div>

                    <asp:Label ID="lblort" runat="server" Text="Ort: "></asp:Label>
                    <ej:ComboBox ID="cbboxOrt" runat="server" Width="200px" Text=""
                        DataSourceID="SqlDataSource1" DataSourceCachingMode="Session"  DataTextField="Ort" DataValueField="OrtNr" Locale="de-DE" NoRecordsTemplate="No Records Found"
                        SortOrder="None">
                    </ej:ComboBox>
                    <asp:Label ID="chkDel" runat="server" Text="Allfällige Daten löschen?"></asp:Label><ej:CheckBox ID="chkdelresdata" runat="server" Checked="false"></ej:CheckBox>
                    <br />
                    <br />
                    <ej:Button ID="btnweiter1" runat="server" Text="Weiter >>" Type="Button" OnClick="btnweiter1_Click"></ej:Button>

                    <br />
                    <asp:Label ID="lblError1" runat="server" ForeColor="Red" Text=""></asp:Label>
                </ContentSection>

            </ej:TabItem>
            <ej:TabItem ID="TabItem2" runat="server" Text="2. Daten hochladen">
                <ContentSection>
                    <div class="tab-title">
                        <h4>CSV-Datei auswählen und hochladen</h4>
                        <br />
                        <ej:UploadBox ID="UploadBox2" runat="server" SaveUrl="~/Resultate/Resultate_saveFiles.ashx" AutoUpload="true" OnInit="UploadBox2_Init" OnComplete="Upload1_Complete"
                            FileSize="12000000">
                        </ej:UploadBox>
                        <br />
                    </div>
                </ContentSection>
            </ej:TabItem>
            <ej:TabItem ID="TabItem3" runat="server" Text="3. Daten importieren">
                <ContentSection>
                    <div class="tab-title">
                        <h4>Daten importieren</h4>
                        <br />
                        Bitte auf "weiter klicken, um die Daten zu imporieren,<br />
                        <ej:Button ID="btnweiter2" runat="server" Text="Weiter >>" Type="Button" OnClick="btnweiter2_Click" ></ej:Button>

                        <br />

                    </div>
                </ContentSection>
            </ej:TabItem>
            <ej:TabItem ID="TabItem4" runat="server" Text="4. Zusammenfassung">
                <ContentSection>
                    <div class="tab-title">
                        <h4>Zusammenfassung</h4>
                        <table>
                            <tr>
                                <td style="width: 100px">Vereine
                                </td>
                                <td>
                                    <asp:Label runat="server" ID="lblvereine" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 100px">Vereine
                                </td>
                                <td>
                                    <asp:Label runat="server" ID="lblathleten" Text=""></asp:Label>
                                </td>
                            </tr>

                        </table>
                    </div>
                    <br />
                </ContentSection>
            </ej:TabItem>
        </Items>
    </ej:Tab>


    <script type="text/javascript">

        function beforeItemActive(args) {
            //if (args.isInteraction == true)
            //    args.cancel = true;
        }
    </script>
</asp:Content>
