<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="FinIQ_EventConfigurationMaster.aspx.vb" Inherits="FinIQWebApp.FinIQ_EventConfigurationMaster" MasterPageFile="~/FiniqAppMasterPage.Master" Title="Event Configuration Master" EnableEventValidation="true" MaintainScrollPositionOnPostback="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>
    <style type="text/css">
        .ui-widget-header
        {
            border: none;
            background-color: none;
        }

        .ui-state-hover
        {
            border: 1px solid #00ADEF;
        }

        .ui-state-active a, .ui-state-active a:link
        {
            color: #00ADEF !important;
            background-color: #F1F1F1 !important;
        }

        .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited
        {
            color: #333333;
        }

        .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active
        {
            border: 1px solid #00ADEF;
        }

        .UpperOuterContainerTable
        {
            float: left;
        }

     

        .tdButton
        {
            width: 170px;
        }

        /*.ui-widget-content {
            border: none !important;
        }*/

        .ui-button
        {
            padding: 0px;
        }

        .tdLabel
        {
            width: 100px;
        }

        .tdLabelShort
        {
            width: 40px;
        }

        .tdLong
        {
            width: 220px;
        }

        .tdFilter
        {
            width: 438px;
        }

        .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus
        {
            border: none !important;
        }

        .lstBox
        {
            display: block !important;
            height: 124px;
            width: 669px;
        }

        .lineHeight
        {
            height: 6px;
        }

        .css-lb
        {
            overflow: hidden;
        }

        .ui-dialog .ui-dialog-content
        {
            min-height: 100px !important;
            background: #f2f2f2;
        }

        .header
        {
            background: #d2d2d2;
        }

        p
        {
            text-align: center;
            padding-top: 10px;
        }


   

        .Disabled-button
        {
            cursor: not-allowed;
        }

        .ddlScheme
        {
            margin-left: 8px;
        }

        .divEventData
        {
            margin-left: 8px;
            margin-top: 12px;
        }
    </style>


    <%--    <link href="../App_Themes/style1.css" rel="stylesheet" type="text/css" />--%>

    <asp:UpdatePanel ID="UpdatePanelCP" runat="server">

        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>

                                    <asp:Label runat="server" ID="lblError" CssClass="lblerror"> </asp:Label>
                                    <asp:Label runat="server" ID="lblProcessMsg" CssClass="lblerror"> </asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

                <tr>
                    <td>
                        <table id="tbMain" runat="server">
                            <tr>
                                <td style="padding-left: 8px;">
                                    <asp:Label ID="lblEntity" CssClass="lbl" runat="server" Text="Entity"></asp:Label>
                                </td>

                                <td style="padding-left: 10px;">
                                    <asp:DropDownList ID="ddlEntity" runat="server" AutoPostBack="true" Width="164px" CssClass="ddl">
                                    </asp:DropDownList>
                                </td>


                                <td style="padding-left: 25px;">
                                    <asp:Label ID="lblEvent" CssClass="lbl" runat="server" Text="Event"></asp:Label>
                                </td>

                                <td style="padding-left: 11px;">
                                    <asp:DropDownList ID="ddlEvent" runat="server" AutoPostBack="true" Width="164px" CssClass="ddl">
                                    </asp:DropDownList>
                                </td>

                                <td style="padding-left: 25px;">
                                    <asp:Label ID="lblScheme" CssClass="lbl" runat="server" Text="Scheme"></asp:Label>
                                </td>

                                <td style="padding-left: 11px;">
                                    <asp:DropDownList ID="ddlScheme" runat="server" AutoPostBack="true" Width="164px" CssClass="ddl">
                                    </asp:DropDownList>
                                </td>

                              <td class="lblBlotterPaddingRight">
                                   <asp:CheckBox ID="chkIncludeDeactivate" runat="server" AutoPostBack="true" Text="Include Deactivated" Checked="false" />

                              </td>
                                                                

                                <%--<td style="padding-left: 25px;">
                                    <asp:Label ID="lblActive" CssClass="lbl" runat="server" Text="Active YN"></asp:Label>
                                </td>

                                <td style="padding-left: 11px;">
                                    <asp:DropDownList ID="ddlActive" runat="server" AutoPostBack="true" Width="164px" CssClass="ddl">
                                    </asp:DropDownList>
                                </td>--%>

                                <td style="padding-left: 25px;">
                                    <asp:Button ID="btnAdd" runat="server" CssClass="btn" Style="width: 80px;" Text="Add"></asp:Button>
                                </td>

                                <td>
                                    <asp:Button ID="btnDelete" runat="server" CssClass="btn" Style="width: 80px;" Text="Delete" OnClientClick="return confirm_user();"></asp:Button>
                                </td>

                                <td>
                                    <asp:Button ID="btnSave" runat="server" CssClass="btn" Style="width: 80px;" Text="Save"></asp:Button>
                                </td>

                                

                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table style="margin-top: 10px;">
                            <tr>
                                <td>
                                    <div runat="server" id="DivEvents">


                                        <asp:GridView ID="grdEventConfigMaster" runat="server" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found" BorderWidth="1"
                                            rules="All" ShowHeader="true" AllowPaging="True" PageSize="20" PagerStyle-Height="32px"
                                            AutoGenerateColumns="false" HeaderStyle-CssClass="GridHeaderTitle"
                                            CssClass="Grid" CellPadding="0" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="false"
                                            CellSpacing="0">

                                            <SelectedRowStyle CssClass="GridItemSelect" />
                                            <RowStyle CssClass="GridItem" />
                                            <HeaderStyle CssClass="GridHeader" />
                                            <FooterStyle CssClass="GridFooter" />
                                            <PagerStyle CssClass="GridPager" />

                                            <PagerSettings Mode="NumericFirstLast"
                                                FirstPageText="First"
                                                LastPageText="Last"
                                                Position="Bottom" />
                                            <EmptyDataTemplate>
                                                <asp:Label ID="lbldatagrid" runat="server" CssClass="lbl" Text="No data found."></asp:Label>
                                            </EmptyDataTemplate>

                                            <Columns>

                                                <asp:TemplateField HeaderText="">
                                                    <HeaderStyle HorizontalAlign="Center" Width="25px" VerticalAlign="Middle"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Center" Width="25px" VerticalAlign="Middle" />
                                                    <HeaderTemplate>
                                                        <%--<asp:CheckBox ID="chkAll" runat="server" AutoPostBack="true" OnCheckedChanged="CheckUncheckAll" />--%>
                                                        <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBoxCol" runat="server" Checked="false" AutoPostBack="true" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>

                                                <asp:CommandField ButtonType="Link" ShowEditButton="true" CancelText="Cancel" UpdateText=""
                                                    EditText="Edit" ItemStyle-Width="60px" HeaderStyle-Width="60px" ItemStyle-HorizontalAlign="Center"
                                                    HeaderStyle-HorizontalAlign="Center"></asp:CommandField>

                                                <asp:TemplateField HeaderText="ID" Visible="false">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblID" runat="server" Text='<%# Eval("ECM_ID")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Sr. No." Visible="false">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblSrNo" runat="server" Text='<%# Eval("ECM_ID")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblID" runat="server" Text='<%# Eval("ECM_ID")%>' Visible="false"></asp:Label>
                                                        <asp:TextBox ID="txtlblID" runat="server" Width="120" CssClass="commontxt ui-widget-header"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Event Name">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="true" Width="250px"></HeaderStyle>
                                                    <ItemStyle Wrap="true" Width="250px" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblEvent_Name" runat="server" Width="250px" Text='<%# Eval("Event_Name")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblEvent_Name" runat="server" Text='<%# Eval("Event_Name")%>' Visible="false"></asp:Label>
                                                        <asp:DropDownList ID="ddlEvent_Name" runat="server" CssClass="ddl" Width="250px" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Warning Days">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="true" Width="50px"></HeaderStyle>
                                                    <ItemStyle Wrap="true" Width="50px" HorizontalAlign="Right" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblWarningDays" runat="server" Width="50px" Text='<%# Eval("Warning_Days")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblWarningDays" runat="server" Width="50px" Text='<%# Eval("Warning_Days")%>' Visible="false"></asp:Label>
                                                        <asp:TextBox ID="txtWarningDays" runat="server" Width="50px" CssClass="txt"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>


                                                <asp:TemplateField HeaderText="Scheme Code">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="true" Width="150px"></HeaderStyle>
                                                    <ItemStyle Wrap="true" Width="150px" HorizontalAlign="Right" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblScheme_Code" runat="server" Width="150px" Text='<%# Eval("Scheme_Name")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblScheme_Code" runat="server" Width="150px" Text='<%# Eval("Scheme_Name")%>' Visible="false"></asp:Label>
                                                        <asp:DropDownList ID="ddlScheme_Code" runat="server" CssClass="ddl" Width="150px" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>


                                                <asp:TemplateField HeaderText="Colour">
                                                    <HeaderStyle Wrap="False" Width="70px"></HeaderStyle>
                                                    <ItemStyle Width="70px" Wrap="false" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblColour" CssClass="lbl" runat="server">
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblColour" runat="server" Text='<%# Eval("Colour")%>' Visible="false"></asp:Label>
                                                        <asp:TextBox ID="txtCardColor" runat="server" Width="70px" Style="cursor: pointer" AutoPostBack="true" />
                                                        <cc1:ColorPickerExtender
                                                            ID="txtCardColor_ColorPickerExtender"
                                                            TargetControlID="txtCardColor"
                                                            Enabled="True"
                                                            runat="server"></cc1:ColorPickerExtender>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Warning Remark">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" Wrap="true"></HeaderStyle>
                                                    <ItemStyle Width="50px" Wrap="true" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblWarningRemark" runat="server" Text='<%# Eval("Warning_Remark")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblWarningRemark" runat="server" Text='<%# Eval("Warning_Remark")%>' Visible="false"></asp:Label>
                                                        <asp:TextBox ID="txtWarningRemark" runat="server" Width="50px" CssClass="txt"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>



                                                <asp:TemplateField HeaderText="Active YN">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" Wrap="false"></HeaderStyle>
                                                    <ItemStyle Width="50px" Wrap="true" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblActiveYN" runat="server" Text='<%# Eval("Active_YN")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblActiveYN" runat="server" Text='<%# Eval("Active_YN")%>' Visible="false"></asp:Label>
                                                        <asp:DropDownList ID="ddlActiveYN" runat="server" CssClass="ddl" Width="50px" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>



                                                <asp:TemplateField HeaderText="Display YN">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" Wrap="true"></HeaderStyle>
                                                    <ItemStyle Width="50px" Wrap="true" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblDisplayYN" runat="server" Text='<%# Eval("Display_YN")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblDisplayYN" runat="server" Text='<%# Eval("Display_YN")%>' Visible="false"></asp:Label>
                                                        <asp:DropDownList ID="ddlDisplayYN" runat="server" CssClass="ddl" Width="50px" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>



                                                <asp:TemplateField HeaderText="Web YN">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" Wrap="true"></HeaderStyle>
                                                    <ItemStyle Width="50px" Wrap="true" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblWebYN" runat="server" Text='<%# Eval("WEB_YN")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblWebYN" runat="server" Text='<%# Eval("WEB_YN")%>' Visible="false"></asp:Label>
                                                        <asp:DropDownList ID="ddlWebYN" runat="server" CssClass="ddl" Width="50px" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>



                                                <%--<asp:TemplateField HeaderText="Email ID" Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblEmailID" runat="server" Text='<%# Eval("UCM7")%>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:Label ID="hdnlblEmailID" runat="server" Text='<%# Eval("UCM7")%>' Visible="false"></asp:Label>
                                                            <asp:TextBox ID="txtEmailID" runat="server" Width="120" CssClass="commontxt ui-widget-header"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>--%>



                                                <asp:TemplateField HeaderText="Event Group Name">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px"></HeaderStyle>
                                                    <ItemStyle Width="80px" Wrap="true" HorizontalAlign="Left" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblEvent_Group_Name" runat="server" Text='<%# Eval("Event_Group_Name")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:Label ID="hdnlblEvent_Group_Name" runat="server" Text='<%# Eval("Event_Group_Name")%>' Visible="false"></asp:Label>
                                                        <asp:TextBox ID="txtEvent_Group_Name" runat="server" Width="80px" CssClass="txt"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </asp:TemplateField>

                                            </Columns>
                                        </asp:GridView>
                                    </div>

                                </td>

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









        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">

        $(document).ready(function () {

            $("html").scrollLeft(0);
        });

        function confirm_user() {
            if (confirm("Are you sure you delete selected record(s)?") == true)
                return true;
            else
                return false;
        }

        function checkAll(chkAll) {

            var GridView = chkAll.parentNode.parentNode.parentNode;
            var inputList = GridView.getElementsByTagName("input");

            //alert(inputList.length);
            for (var i = 0; i < inputList.length; i++) {

                //var row = inputList[i].parentNode.parentNode;
                if (inputList[i].type == "checkbox" && chkAll != inputList[i]) {
                    if (chkAll.checked) {
                        inputList[i].checked = true;
                    }
                    else {
                        inputList[i].checked = false;
                    }
                }
            }
        }
    </script>
</asp:Content>
