<%@ Page Language="vb" MasterPageFile="~/WFAdmin/ModalAdminPage.master" AutoEventWireup="false" CodeBehind="ConfigDataSources.aspx.vb" Inherits="WebFoundations.WFForms.UI.ConfigDataSources" %>

<asp:Content ContentPlaceHolderID="taghead" runat="server">
    <script type="text/javascript">
        function CloseAndRebind(formula) {
            try {
                var w = GetRadWindow();
                if (w) {
                    w.Close();
                    w.BrowserWindow.UpdateDataPanel(formula);
                }
            } catch (error) { }
        }
    </script>
</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <asp:PlaceHolder ID="pnlInsert" runat="server">
        <section class="actions">
            <asp:Button ID="btnInserirSQL" Width="150px" runat="server" />&nbsp;&nbsp;
            <asp:Button ID="btnInserirXML" Width="150px" runat="server" />&nbsp;&nbsp;
            <asp:Button ID="btnInserirWEB" Width="150px" runat="server" />&nbsp;&nbsp;
            <asp:Button ID="btnInsertForm" Width="150px" runat="server" />&nbsp;&nbsp;
            <asp:Button ID="btnInserirFormula" Width="150px" runat="server" />&nbsp;&nbsp;
        </section>
    </asp:PlaceHolder>
    <!------------------------------Painel PROCEDURE------------------------------------------>
    <asp:PlaceHolder ID="pnlSQL" runat="server" Visible="false">
        <div class="fields no-columns">
            <h4>
                <asp:Literal ID="lblSubTitleSql" runat="server" /></h4>
            <label>
                <asp:Label ID="lblconnection" runat="server" />
                <asp:DropDownList ID="lstconnection" runat="server" />
            </label>
            <div>
                <asp:Label ID="lblprocname" runat="server" />
                <div>
                    <asp:TextBox ID="txtprocname" runat="server" Style="width: 80%; display: inline;" MaxLength="100" />
                    <asp:Button ID="btnconfig" Style="width: 80px; display: inline; margin-left: 5px;" runat="server" />
                    <asp:RequiredFieldValidator ID="obrprocname" runat="server" ControlToValidate="txtprocname" Display="Dynamic" />
                </div>
            </div>
            <asp:PlaceHolder ID="phParametros" runat="server">
                <h4>
                    <asp:Literal ID="lbltestparam" runat="server" /></h4>
                <asp:Repeater ID="lstParam" runat="server">
                    <HeaderTemplate>
                        <table>
                            <tr class="gridCaption">
                                <td>
                                    <asp:Label ID="lblParametros" runat="server" /></td>
                                <td>
                                    <asp:Label ID="lblParDefValue" runat="server" /></td>
                                <td>
                                    <asp:Label ID="lblContexto" runat="server" /></td>
                                <td>
                                    <asp:Label ID="lblTeste" runat="server" /></td>
                            </tr>
                    </HeaderTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                    <ItemTemplate>
                        <tr class="gridRow">
                            <td>
                                <asp:Label ID="lblparname" runat="server" CssClass="destaque" />
                                <asp:Label ID="lblpardets" runat="server" Visible="false" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtparvalue" runat="server" Text="NULL" />
                            </td>
                            <td>
                                <asp:DropDownList ID="lstContext" runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtpartstvalue" runat="server" Text="NULL" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </asp:PlaceHolder>
            <asp:PlaceHolder ID="phParamSaida" runat="server">
                <div>
                    <h4>
                        <asp:Literal ID="lblParamSaida" runat="server" /></h4>
                    <div>
                        <asp:Label ID="lblCampos" runat="server" CssClass="destaque"></asp:Label>
                    </div>
                </div>
            </asp:PlaceHolder>
        </div>
        <section class="actions">
            <asp:Button ID="btntest" runat="server" Width="100px" Visible="False" />
            <asp:Button ID="btnok" runat="server" Visible="False" />
            <asp:Button ID="btncancelsql" runat="server" Text="btncancelsql" CausesValidation="False" />
            <asp:Label ID="lblformat" runat="server" Visible="False" />
        </section>
    </asp:PlaceHolder>
    <!------------------------------Painel XML------------------------------------------>
    <asp:PlaceHolder ID="pnlXML" runat="server" Visible="false">
        <div class="fields no-columns">
            <!--------------------------------------------------->
            <h4>
                <asp:Literal ID="lblSubTitleXML" runat="server" /></h4>
            <asp:RadioButtonList runat="server" ID="rdbXmlType" AutoPostBack="true" OnSelectedIndexChanged="rdbXmlType_SelectedIndexChanged" RepeatDirection="Horizontal">
                <asp:ListItem Text="Arquivo" Value="file" Selected="True" />
                <asp:ListItem Text="Formulário" Value="form" />
            </asp:RadioButtonList>
            <label runat="server" id="pnlXmlFile">
                <asp:Label ID="lblfilename" runat="server" />
                <input id="impupload" type="file" name="impupload" runat="server" />
            </label>
            <label runat="server" id="pnlXmlForm" visible="false">
                <asp:Label runat="server" ID="lblXmlForm" />
                <asp:DropDownList runat="server" ID="ddlXmlForm" />
            </label>
        </div>
        <section class="actions">
            <asp:Button ID="btnokxml" runat="server" Text="OK" />
            <asp:Button ID="btncancelxml" runat="server" Text="btncancelxml" />
        </section>
    </asp:PlaceHolder>
    <!------------------------------Painel FORMULÁRIO------------------------------------------>
    <asp:PlaceHolder ID="pnlForm" runat="server" Visible="false">
        <asp:HiddenField runat="server" ID="hidFormDataSourceName" />
        <div class="fields no-columns">
            <!--------------------------------------------------->
            <h4>
                <asp:Literal ID="lblSubTitleForm" runat="server" /></h4>
            <label>
                <asp:Label ID="lblFormName" runat="server" />
                <asp:DropDownList runat="server" ID="ddlForms" AutoPostBack="true" OnSelectedIndexChanged="ddlForms_SelectedIndexChanged" />
            </label>
        </div>
        <div runat="server" id="divFields">
            <div>
                <label>
                    <asp:Label runat="server" ID="lblOrderByFieldForm" />
                    <asp:DropDownList runat="server" ID="ddlOrderByFieldForms" />
                    <asp:RadioButtonList runat="server" ID="rdbOrderByFieldsForms" RepeatDirection="Horizontal">
                        <asp:ListItem Text="Sem ordenação" Value="0" />
                        <asp:ListItem Text="Ascendente" Value="1" />
                        <asp:ListItem Text="Descendente" Value="2" />
                    </asp:RadioButtonList>
                </label>
            </div>
            <div>
                <label>
                    <asp:Label ID="lblFieldsFormValue" runat="server" />
                    <asp:DropDownList runat="server" ID="ddlFieldsFormValue" />
                </label>
            </div>
            <div>
                <label>
                    <asp:Label runat="server" ID="lblFieldsFormText" />
                    <asp:DropDownList runat="server" ID="ddlFieldsFormText" />
                </label>
            </div>
        </div>
        <section class="actions">
            <asp:Button ID="btnOKForm" runat="server" Text="OK" OnClick="btnOKForm_Click" />
            <asp:Button ID="btnCancelForm" runat="server" Text="btncancelxml" OnClick="btnCancelForm_Click" />
        </section>
    </asp:PlaceHolder>
    <!------------------------------Painel WEBSERVICE--------------------------------------->
    <asp:PlaceHolder ID="pnlWEB" runat="server" Visible="false">
        <div class="fields no-columns">
            <div>
            <h4>
                <asp:Literal ID="lblSubTitleWEB" runat="server" />
            </h4>
                </div>
            
            <fieldset id="fldAutenticacao">
            <legend>
                <asp:Label ID="lblAutenticacaoWS" runat="server" Text="Autenticação de Usuário" />
            </legend>
            <label>
                <asp:RadioButtonList ID="rdlTipoAutenticacao" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" >
                    <asp:ListItem Value="0" Selected="true"></asp:ListItem>
                    <asp:ListItem Value="1" ></asp:ListItem>
                    <asp:ListItem Value="2"></asp:ListItem>
                </asp:RadioButtonList>
            </label>

           <asp:panel ID="pnlAuthentication" runat="server" Visible="false">
                <asp:Label ID="lblAutenticacaoUsuario" runat="server" style="float:left !important;" Width="60px" />
                <asp:RequiredFieldValidator ID="rfvUsuario" runat="server" ValidationGroup="tstEndPoint" Display="Dynamic" ControlToValidate="txtUsuario" Text="*" />
                <asp:TextBox ID="txtUsuario" runat="server" MaxLength="50"  ClientIDMode ="Static" AutoCompleteType="None" />
                <asp:Label ID="lblAutenticacaoSenha" runat="server" />
                <asp:RequiredFieldValidator ID="rfvSenha" runat="server" ValidationGroup="tstEndPoint" Display="Dynamic" ControlToValidate="txtSenha" Text="*" />
                <asp:TextBox ID="txtSenha" runat="server" TextMode="Password" MaxLength="20"  ClientIDMode="Static" AutoCompleteType="None"  />
           </asp:panel>

        </fieldset>
            <div>
                <asp:Label ID="lblUrlWeb" runat="server" />
                <div>
                    <asp:TextBox ID="txtUrlWeb" runat="server" Style="width: 80%; display: inline;" MaxLength="200" />
                    <asp:Button ID="btnSearchWeb" Style="width: 80px; display: inline; margin-left: 5px;" runat="server" />
                </div>
            </div>
            <label>
                <asp:Label ID="lblMethodsWeb" runat="server" />
                <asp:DropDownList ID="lstMethodsWeb" runat="server" AutoPostBack="True" />
                <asp:RequiredFieldValidator ID="rfvMethodsWeb" runat="server" ControlToValidate="lstMethodsWeb" Display="Dynamic" />
            </label>
            <asp:PlaceHolder ID="parametrosWeb1" runat="server" Visible="false">
                <h4>
                    <asp:Literal ID="lblTestParamsWeb" Text="Parâmetros" runat="server" /></h4>
                <div>
                    <asp:Repeater ID="lstParamWeb" runat="server">
                        <HeaderTemplate>
                            <table>
                                <tr class="gridCaption">
                                    <td>
                                        <asp:Label ID="lblParametros" runat="server" /></td>
                                    <td>
                                        <asp:Label ID="lblParDefValue" runat="server" /></td>
                                    <td>
                                        <asp:Label ID="lblContexto" runat="server" /></td>
                                    <td>
                                        <asp:Label ID="lblTeste" runat="server" /></td>
                                </tr>
                        </HeaderTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                        <ItemTemplate>
                            <tr class="gridRow">
                                <td>
                                    <asp:Label ID="lblparname" runat="server" CssClass="destaque" />
                                    <asp:Label ID="lblpardets" runat="server" Visible="false" />
                                </td>
                                <td>
                                    <asp:TextBox ID="txtparvalue" runat="server" Text="NULL" /></td>
                                <td>
                                    <asp:DropDownList ID="lstContext" runat="server" /></td>
                                <td>
                                    <asp:TextBox ID="txtpartstvalue" runat="server" Text="NULL" /></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
            </asp:PlaceHolder>
            <asp:PlaceHolder ID="ParametrosSaidaWeb" runat="server">
                <h4>
                    <asp:Literal ID="lblParamSaidaWeb" runat="server" /></h4>
                <table>
                    <asp:Label ID="lblCamposWeb" runat="server" />
                </table>
            </asp:PlaceHolder>
        </div>
        <section class="actions">
            <asp:Button ID="btnTestWeb" runat="server" Visible="False" />
            <asp:Button ID="btnOkWeb" runat="server" Visible="False" />
            <asp:Button ID="btnCancelWeb" runat="server" CausesValidation="False" />
            <asp:Label ID="lblFormatWeb" runat="server" Visible="False" />
        </section>
    </asp:PlaceHolder>
    <!------------------------------Painel FORMULA--------------------------------------->
    <asp:Panel ID="pnlFormula" runat="server" Visible="false">
        <div class="fields no-columns">
            <h4>
                <asp:Literal ID="lblSubTitleFORMULA" runat="server" /></h4>
            <label>
                <asp:Label runat="server" ID="lblFormulaMetodos" />
                <asp:DropDownList runat="server" ID="ddlFormulaMetodos" AutoPostBack="true" OnSelectedIndexChanged="ddlFormulaMetodos_SelectedIndexChanged" />
            </label>
            <div>
                <asp:Label runat="server" ID="lblFormulaParams" />
                <table>
                    <asp:Repeater runat="server" ID="rptFormulaParams">
                        <HeaderTemplate>
                            <tr>
                                <td>
                                    <asp:Label runat="server" ID="lblParametros" /></td>
                                <td>
                                    <asp:Label runat="server" ID="lblTipoParam" /></td>
                                <td>
                                    <asp:Label runat="server" ID="lblParDefValue" /></td>
                                <td>
                                    <asp:Label runat="server" ID="lblContexto" /></td>
                                <td>
                                    <asp:Label runat="server" ID="lblTeste" /></td>
                            </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <asp:Label runat="server" ID="lblParam" /></td>
                                <td>
                                    <asp:Label runat="server" ID="lblParamType" /></td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtValue" /></td>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlValue" /></td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtValueTest" /></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr id="ParametrosSaidaFormula1" runat="server">
                        <td>
                            <h4>
                                <asp:Literal ID="lblParamSaidaFormula" runat="server" /></h4>
                        </td>
                    </tr>
                    <tr id="ParametrosSaidaFormula2" runat="server">
                        <td>
                            <asp:Label ID="lblCamposFormula" runat="server" CssClass="destaque" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <section class="actions">
            <asp:Button runat="server" ID="btnFormulaOK" Enabled="false" OnClick="btnFormulaOK_Click" />
            <asp:Button runat="server" ID="btnFormulaTest" Enabled="false" OnClick="btnFormulaTest_Click" />
            <asp:Button runat="server" ID="btnFormulaCancel" OnClick="btnFormulaCancel_Click" />
            <asp:Label ID="lblFormatFormula" runat="server" Visible="False" />
        </section>
    </asp:Panel>
</asp:Content>


