<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master"
    CodeBehind="Registration.aspx.vb" Inherits="FinIQWebApp.Registration" Title="Registration" %>

<%@ Register Src="~/FinIQ_User_Controls/DateControl.ascx" TagName="DateControl" TagPrefix="uc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        .ddlWidth
        {
            width: 130px;
        }

        .ddlTDWidth
        {
            width: 155px;
        }

        .btnWidth
        {
            width: 70px;
        }

        .lbl
        {
            white-space: nowrap;
        }

        .imgColWidth
        {
            min-width: 30px;
            text-align:center;
        }
    </style>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>

            <table class="">
                <%-- <tr>
                    <td class="background_gray">Registration
                    </td>
                </tr>--%>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblError" runat="server" CssClass="lblerror"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td style="width: 60px;">
                                    <asp:Label ID="Label8" runat="server" CssClass="lbl">Tab Name</asp:Label>
                                </td>
                                <td class="ddlTDWidth">
                                    <asp:DropDownList ID="ddlApp_name" runat="server" CssClass="ddl ddlWidth">
                                    </asp:DropDownList>
                                </td>
                                <td style="width: 30px;">
                                    <asp:Label ID="Label6" runat="server" CssClass="lbl">Type</asp:Label>
                                </td>
                                <td class="ddlTDWidth">
                                    <asp:DropDownList ID="ddltype" runat="server" CssClass="ddl ddlWidth">
                                        <asp:ListItem Text="ALL" Value="ALL" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Application ID" Value="Application ID"></asp:ListItem>
                                        <asp:ListItem Text="Application Name" Value="Application Name"></asp:ListItem>
                                        <%--<asp:ListItem Text="Tab Name" Value="Tab Name"></asp:ListItem>--%>
                                    </asp:DropDownList>
                                </td>
                                <td style="width: 30px;">
                                    <asp:Label ID="Label9" runat="server" CssClass="lbl">Find</asp:Label>
                                </td>
                                <td style="width: 280px;">
                                    <asp:TextBox ID="txtFind" runat="server" Width="250px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Button ID="cmdload" runat="server" Text="Load" CssClass="btn btnWidth"></asp:Button>
                                </td>
                                <td>
                                    <asp:Button ID="cmdAdd" runat="server" Text="Add" CssClass="btn btnWidth"></asp:Button>
                                </td>
                                <td>
                                    <asp:Button ID="cmdSave" runat="server" Text="Save" CssClass="btn btnWidth"></asp:Button>
                                </td>
                                <td style="width: 100px;">
                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" Enabled="False" CssClass="btn btnWidth"></asp:Button>
                                </td>
                                <td style="width: 90px;">
                                    <asp:Label ID="Label7" runat="server" CssClass="lbl">Rows Per Page</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtRowsPerPage" runat="server" AutoPostBack="true" OnTextChanged="TxtRowsPerPage_TextChanged" Width="40px"></asp:TextBox>
                                </td>


                            </tr>
                        </table>
                    </td>
                </tr>


                <script type="text/javascript">
                    function setGridSize() {
                        $(document).ready(function () {
                            $(".divGrid").width(($(window).width() - 50) + "px");
                            $(".divGrid").height(($(window).height() - 190) + "px");
                            $(".tbl").width(($(window).width() - 50) + "px");
                        });
                    }


                    $(window).resize(function () {
                        setGridSize();
                    });
                    $(window).load(function () {
                        setGridSize();
                    });


                    setGridSize();
                </script>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>

                                    <div class="divGrid">

                                        <asp:DataGrid ID="DGR_Reg" runat="server" PageSize="20" AutoGenerateColumns="False"
                                            AllowPaging="True" CssClass="Grid">
                                            <SelectedItemStyle CssClass="GridItemSelect" />
                                            <ItemStyle CssClass="GridItem" />
                                            <HeaderStyle CssClass="GridHeader" Wrap="true" HorizontalAlign="Center" VerticalAlign="Middle" />
                                            <FooterStyle CssClass="GridFooter" />
                                            <PagerStyle CssClass="GridPager" />

                                            <Columns>
                                                <%-- <img src='../App_Resources/pencil.png <img src='../App_Resources/disk.png <img src='../App_Resources/bin_closed.png' />--%>
                                                <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="<img src='../App_Resources/update.png' alt='U' title='Update' border='0'>" 
                                                    CancelText="<img src='../App_Resources/cancel.png' title='Cancel' alt='C' border='0'>" 
                                                    EditText="<img src='../App_Resources/edit.png' alt='E' title='Edit' border='0'>" 
                                                    ItemStyle-CssClass="imgColWidth" HeaderStyle-CssClass="imgColWidth">
                                                </asp:EditCommandColumn>
                                                <asp:ButtonColumn ButtonType="LinkButton" Text="<img src='../App_Resources/delete.png' alt='D' title='Delete' border='0' />"
                                                     CommandName="Delete" ItemStyle-CssClass="imgColWidth" HeaderStyle-CssClass="imgColWidth"></asp:ButtonColumn>
                                                <asp:TemplateColumn SortExpression="App_No" HeaderText="No">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppNo").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txt_AppNo" Visible="False" ReadOnly="true" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppNo").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="App_Id" HeaderText="App Id">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppId").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppId" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppId").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="App_Name" HeaderText="App Name">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppName").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_Appname" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppName").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="App_Path" HeaderText="App Path">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label10" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppPath").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txt_Apppath" Width="400px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppPath").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="Registeration_Date" HeaderText="Registration Date">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lbl_regdate" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.RegisterationDate").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txt_Regdate" ReadOnly="true" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.RegisterationDate").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="Created_By" HeaderText="Created By">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label20" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.CreatedBy").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txt_CreatedBy" Width="60px" ReadOnly="true" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.CreatedBy").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn HeaderText="Version">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label5" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppVersion").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppVersion" Width="60px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppVersion").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="App_Expiry_Date" HeaderText="Expiry Date" Visible="true">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lbl_expdate" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppExpiryDate").ToString)%>'>
                                                        </asp:Label>
                                                        <uc1:DateControl ID="dtpexpirydate" runat="server" CalenderCss="btn1" TextBoxCss="txt"
                                                            Visible="false" AutoPostBack="false" />
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn HeaderText="Tab Name">

                                                    <ItemStyle Wrap="False" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LblTabName" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMisc1").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="ddltabname" runat="server" Visible="false" />
                                                        <asp:TextBox ID="txttabname" runat="server" Visible="false"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn HeaderText="Misc2">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label30" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMisc2").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txt_Misc2" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMisc2").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn HeaderText="Allow Appl. Access">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkEdit" runat="server" Checked='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AllowAppAccess").ToString)%>' AutoPostBack="false" Enabled="false"></asp:CheckBox>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:CheckBox ID="chkEdit" runat="server"
                                                            AutoPostBack="false" Enabled="true"></asp:CheckBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:BoundColumn HeaderText="App Password" Visible="true" DataField="App_Password" ReadOnly="True"></asp:BoundColumn>
                                                <asp:TemplateColumn HeaderText="App Dnet Version" ItemStyle-Width="50px">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="GridItem"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblAppDnetVersion" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppDNETVersion").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>

                                                        <asp:DropDownList ID="ddlAppDnetVersion" runat="server" Width="60px" CssClass="ddl">
                                                            <asp:ListItem Value="4.5">4.5</asp:ListItem>
                                                            <asp:ListItem Value="3.5">3.5</asp:ListItem>
                                                            <asp:ListItem Value="1.1">1.1</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="AppMenuHeaderCaption" HeaderText="App Menu Header Caption">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LabelAppMenuHeader" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMenuHeaderCaption").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppMenuHeaderCaption" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMenuHeaderCaption").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="AppWarningDays" HeaderText="Warning Days">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LabelAppWarningDays" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppWarningDays").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppWarningDays" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppWarningDays").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="AppMaxCopies" HeaderText="Max Copies">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LabelAppMaxCopies" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMaxCopies").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppMaxCopies" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMaxCopies").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="AppHelp" HeaderText="Application Help">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LabelAppHelp" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppHelp").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppHelp" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppHelp").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                                <asp:TemplateColumn SortExpression="AppMenuOrder" HeaderText="App Menu Order">

                                                    <ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="LabelAppMenuOrder" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMenuOrder").ToString)%>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txt_AppMenuOrder" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.AppMenuOrder").ToString)%>'>
                                                        </asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateColumn>
                                            </Columns>
                                            <PagerStyle CssClass="GridFooter" HorizontalAlign="Left" Mode="NumericPages" />
                                        </asp:DataGrid>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <asp:TextBox ID="txt_sortorder" runat="server" Visible="False">Desc</asp:TextBox>



        </ContentTemplate>
    </asp:UpdatePanel>




</asp:Content>
