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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<style type="text/css">
            .DataSizeWidth {
            /*min-width:110px;
            max-width:110px;*/
            width: auto;
        }
    .DisplayWidth {
            /*min-width:120px;
            max-width:120px;*/
            width: auto;
        }

        .CaptionWidth {
            /*min-width:120px;
            max-width:120px;*/
            width: auto;
        }

</style>

<script type="text/javascript">
  
    function EnterEvent(e) {
        if (e.keyCode == 13) {
            document.getElementById('<%=btnLoad.ClientID%>').click();
            }
    }

    function ConfirmDelete() {

        var count = document.getElementById("<%=hdnCheckedCount.ClientID%>").value;
        
         if (count == 0) {
             FinIQ_Notify('Please select record(s) to delete', 'alert')
             return false;
         }
         else {
             return confirm("Do you want to delete " + count + " record(s)?");
         }
     }
    </script>
     <asp:HiddenField ID="hdnCheckedCount" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
             <asp:Label ID="lblMessage" runat="server" CssClass="lblError" Text="" ForeColor="#0368B6" Style="margin-left: 10px"></asp:Label>
            <asp:Label ID="lblError" runat="server" CssClass="lblError" Text="" ForeColor="red" Style="margin-left: 10px"></asp:Label>

            <div id="Controls">
            <table>
                <tr>
                     <td>
                            <asp:Label ID="lblSearchBy" CssClass="lbl" runat="server" Text="Search By"></asp:Label>
                            <asp:DropDownList ID="cboSearch" runat="server" Width="185px" CssClass="ddl" AutoPostBack="true" Enabled="false">
                                <asp:ListItem>Icon Name</asp:ListItem>
                                <asp:ListItem>Datatype</asp:ListItem>                               
                                <asp:ListItem>Visible</asp:ListItem>
                            </asp:DropDownList>
                            <asp:TextBox ID="txtsearch" runat="server" Width="185px" CssClass="Search"  onkeydown="return EnterEvent(event)" AutoPostBack="true"></asp:TextBox>
                              
                        </td>
                    <td style="width: 40px;">
                                    <asp:Button ID="btnSearch" runat="server" CssClass="btnSearch" />
                                </td>
                    <td>
                        <asp:Button ID="btnLoad" runat="server" Text="Load" CssClass="btn" Width="100"/>
                    </td>

                    <td>
                        <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn" Width="100"/>
                    </td>
                    <td>
                         <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="btn" Width="100"/>
                    </td>
                    <td>
                         <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="btn" Width="100"/>
                    </td>
                     <td>
                         <asp:Button ID="btnupdate" runat="server" Text="Update" CssClass="btn" Width="100" Visible="false" />
                    </td>
                   <%--  <td>
                        <asp:FileUpload ID="fileuploadIcon" type="file" size="52" name="clientfile" runat="server" Width="300px" />
                    </td>--%>
                </tr>
                <tr>
                   
                </tr>
            </table>
            </div>

            <div id="GridDiv">
                <asp:GridView ID="grdIconCollection" runat="server" CssClass="Grid" AllowSorting="True" ShowHeaderWhenEmpty="True" AllowPaging="true" PageSize="15" EmptyDataText="No Records Found" AutoGenerateColumns="false">
                     <SelectedRowStyle CssClass="GridItemSelect" />
                    <RowStyle CssClass="GridItem" />
                    <HeaderStyle CssClass="GridHeader" />
                    <FooterStyle CssClass="GridFooter" />
                    <PagerStyle CssClass="GridPager" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderStyle Wrap="true" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" />
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="true"  OnCheckedChanged="chkAll_CheckedChanged"/>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkSingle" runat="server" AutoPostBack="true" OnCheckedChanged="chkSingle_CheckedChanged" />
                            </ItemTemplate>
                          </asp:TemplateField>

                          <asp:CommandField ButtonType="Link" EditText="Edit" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" ItemStyle-Wrap="false" ShowEditButton="true" UpdateText="Update" CancelText="Cancel" ShowCancelButton="True"/>

                        <asp:TemplateField HeaderText="Sr No" Visible="False">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            <ItemTemplate>
                                <asp:Label ID="lblSr_No" runat="server" Text='<%# Eval("SrNo")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField HeaderText="Icon">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>

                            <ItemTemplate>
                                 <asp:FileUpload ID="fileuploadIcon" type="file" size="52" name="clientfile" runat="server" Width="246px"  />
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Image">
                             <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px"></HeaderStyle>
                             <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"/>
                            <ItemTemplate >
                                <asp:Image ID="imgicon" runat="server"/>
                            </ItemTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField HeaderText="Icon Name">
                            <HeaderStyle Wrap="true" Width="100px"></HeaderStyle>
                            <ItemStyle Wrap="True" />
                            <ItemTemplate>
                                 <asp:Label ID="lblName" runat="server" CssClass="lbl" Text='<%#Eval("IconName")%>'></asp:Label>      
                                <asp:TextBox ID="TxtName" runat="server"  Width="180px"  Visible="FALSE"></asp:TextBox>
                             </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Icon Path" visible="false">
                            <HeaderStyle Wrap="true"></HeaderStyle>
                            <ItemStyle Wrap="True" />
                            <ItemTemplate>
                                 <asp:Label ID="lblPath" runat="server" CssClass="lbl" Text='<%#Eval("IconPath")%>'></asp:Label>      
                                <asp:TextBox ID="TxtPath" runat="server"  Width="180px"  Visible="false"></asp:TextBox>
                           </ItemTemplate>
                            
                        </asp:TemplateField>

                           <asp:TemplateField HeaderText="Data Size" >
                            <HeaderStyle Wrap="False" Width="50px"></HeaderStyle>
                            <ItemStyle Wrap="True" />
                            <ItemTemplate>
                                 <asp:Label ID="lblDataSize" runat="server" CssClass="lbl" Text='<%# Eval("DataSize")%>'> </asp:Label>                 
                                 <%-- <asp:TextBox ID="txtDataSize" runat="server"  Width="110px"  Visible="false"></asp:TextBox>--%>
                             </ItemTemplate>
                        </asp:TemplateField>

                          <asp:TemplateField HeaderText="Visible">
                            <HeaderStyle Wrap="False" Width="50px"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="lblVisible" runat="server" CssClass="lbl" Text='<%# Eval("Visible_YN")%>'></asp:Label>
                                    <asp:DropDownList ID="ddlVisible" runat="server" Width="110px"  Visible="false">
                                        <asp:ListItem>Y</asp:ListItem>
                                        <asp:ListItem>N</asp:ListItem>
                                  </asp:DropDownList>
                           </ItemTemplate>
                        </asp:TemplateField>


                          <asp:TemplateField HeaderText="Verify">
                            <HeaderStyle Wrap="False" Width="50px"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="lblVerify" runat="server" CssClass="lbl" Text='<%# Eval("Verify_YN")%>'  ></asp:Label> 
                                     <asp:DropDownList ID="ddlVerify" runat="server" Width="110px"  Visible="false">
                                     <asp:ListItem>Y</asp:ListItem>
                                     <asp:ListItem>N</asp:ListItem>
                                  </asp:DropDownList>
                             </ItemTemplate>
                            
                        </asp:TemplateField>

                       
                         <asp:TemplateField HeaderText="Created By" >
                           <HeaderStyle Wrap="False"></HeaderStyle>
                           <ItemStyle HorizontalAlign="Center" Wrap="True" />
                           <ItemTemplate>
                             <asp:Label ID="lblCreatedBy" Width="80px" runat="server"  AutoPostBack="true"  Style="border: 0px solid !important;" Text='<%#Eval("CreatedBy")%>'></asp:Label>
                           </ItemTemplate>
                       </asp:TemplateField>

                         <asp:TemplateField HeaderText="Created At" >
                           <HeaderStyle Wrap="False"></HeaderStyle>
                           <ItemStyle HorizontalAlign="Center" Wrap="True" />
                           <ItemTemplate>
                              <asp:Label ID="lblCreatedAt" Width="80px" runat="server" AutoPostBack="true" Style="border: 0px solid !important;" Text='<%#Eval("CreatedAt")%>'></asp:Label>
                           </ItemTemplate>
                       </asp:TemplateField>
                    </Columns>
                </asp:GridView>
             
            </div>
        </ContentTemplate>
        <Triggers>

       

        <asp:PostBackTrigger ControlID = "btnSave" />
             <asp:PostBackTrigger ControlID = "btnupdate" />
    </Triggers>
       
    </asp:UpdatePanel>
</asp:Content>
