<%@ Page Title="" Language="C#" MasterPageFile="~/masterpages/eDashboard.master"
    AutoEventWireup="true" CodeBehind="Programs.aspx.cs" Inherits="WebSite.site.Administrative.OnlineClaimsConfig.Programs" %>
<%@ Register TagPrefix="eSecuritelHITSControls" Namespace="WebSite.Controls" Assembly="WebSite" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="server">
  
  <asp:UpdatePanel ID="upnlMain" UpdateMode="Always" runat="server">
        <ContentTemplate>  
            <div class="mastersearch">
                <table cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                        <td align="left">
                            <h1>
                                <asp:Label ID="lblClientProgramEdit" runat="server" Font-Bold="False" Text="Client Program Edit"></asp:Label>
                            </h1>
                        </td>
                    </tr>
                </table>
            </div>
            
            <div style="background-color: #DBDCDE">
                <asp:Button ID="btnAddProgram" Text="Add New Program" runat="server" />
            </div>
            
            <br />

            <asp:Panel ID="pnlClientPrograms" Height="400" ScrollBars="Auto" runat="server">
                <asp:GridView ID="gvClientPrograms" AutoGenerateColumns="false" runat="server" ShowHeader="true"
                OnRowCreated="gvClientPrograms_OnRowCreated" OnRowCommand="gvClientPrograms_OnRowCommand" 
                DataKeyNames="ClientProgramId" OnRowDeleting="gvClientPrograms_RowDeleting" >
                    <Columns>
                        <asp:TemplateField HeaderText="Client" >
                            <ItemTemplate>
                                <asp:Label ID="lblCompanyName" Text='<%# GetNameFromId(Eval("ClientId"),"company") %>' runat="server" />
                            </ItemTemplate>
                            <HeaderTemplate>
                                <asp:DropDownList ID="ddlCompany"  runat="server" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Program" >
                            <ItemTemplate>
                                <asp:Label ID="lblProgramName" Text='<%# GetNameFromId(Eval("ProgramId"),"program") %>' runat="server" />
                            </ItemTemplate>
                            <HeaderTemplate>
                                <asp:DropDownList ID="ddlProgram"  runat="server" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Program Type" >
                            <ItemTemplate>
                                <asp:Label ID="lblProgramTypeName" Text='<%# GetNameFromId(Eval("ProgramType"),"programtype") %>' runat="server" />
                            </ItemTemplate>
                            <HeaderTemplate>
                                <asp:DropDownList ID="ddlProgramType"  runat="server" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="" DataField="Active" />
                        <asp:ButtonField ButtonType="Link" Text="Delete" CommandName="Delete" />
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:LinkButton ID="btnAddNew" Text="Add" CommandName="Add" runat="server" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <AlternatingRowStyle BackColor="#eeeeee" />
                    <RowStyle HorizontalAlign = "Left" />
                    <HeaderStyle BackColor="#DBDCDE" Font-Bold="True" HorizontalAlign = "Left" />
                </asp:GridView>
            </asp:Panel>

            <asp:Panel ID="pnlAddProgram" style="display:none;width:600px;"  runat="server">
                <asp:Panel ID="pnlCancelHeader" runat="server" EnableViewState = "False"  
                    CssClass="modalHeader">                
                    <asp:Localize ID="Localize2" runat="server" EnableViewState = "False"  
                        Text="Add Program"  />                
                </asp:Panel>
                <div class="ModalPopup">
                    <table>
                        <tr>
                            <td>
                                <asp:Literal ID="litProgramName" Text="Program Name:" runat="server" />"
                            </td><td>
                                <asp:TextBox ID="txtProgramName" runat="server" />
                            </td>
                        </tr><tr>
                            <td>
                                <asp:Literal ID="litProgramDescription" Text="Program Description:" runat="server" />
                            </td><td>
                                <asp:TextBox ID="txtProgramDescription" runat="server" />
                            </td>
                        </tr><tr>
                            <td>
                                <asp:Literal ID="litIsGlobal" Text="Is Global:" runat="server" />
                            </td><td>
                                <asp:CheckBox ID="chkIsGlobal" runat="server" />
                            </td>
                        </tr><tr>
                            <td>
                                <asp:Literal ID="litIsActive" Text="Is Active:" runat="server" />
                            </td><td>
                                <asp:CheckBox ID="chkIsActive" runat="server" />
                            </td>
                        </tr><tr>
                            <td colspan="2">
                                <asp:Button ID="btnSaveProgram" Text="Save" OnClick="btnSaveProgram_Click" runat="server" />
                                &nbsp &nbsp
                                <asp:Button ID="btnCancelProgram" Text="Cancel" runat="server" />
                            </td>
                        </tr>
                    </table>    
                </div>
            </asp:Panel>
            
            <eSecuritelHITSControls:HITSModalPopupExtender ID="mpAddProgram" CancelControlID="btnCancelProgram" BackgroundCssClass="ModalPopupBG" 
            PopupControlID="pnlAddProgram" TargetControlID="btnAddProgram" Enabled="true" runat="server" />
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSaveProgram" />
        </Triggers>
    </asp:UpdatePanel>

</asp:Content>
