<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" 
CodeBehind="NotificationTemplates.aspx.cs" Inherits="NotificationTemplates"
Title="Brightstar Device Protection: Notification Templates" Theme="eMain" Culture="auto" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Controls/HITSCalendar.ascx" TagName="HITSCalendar" TagPrefix="uc" %>
<%@ Register Src="~/Controls/ScriptingHelper.ascx" TagName="ScriptingHelper" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components" TagPrefix="cc1" %>
<%@ Register Src="~/Controls/CustomSorter.ascx" TagName = "CustomSorter" TagPrefix = "uc" %>


<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server"> 

    <script type="text/javascript" src="../../../script/eGridHelper.js" ></script> 
    <script type="text/javascript" src="../../../script/eSetFormcontrols.js" ></script> 

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <Triggers>
       
    </Triggers>
       
    <ContentTemplate>
        </ContentTemplate>
        </asp:UpdatePanel>
        
        <telerik:RadGrid ID="Gridview1" runat="server" Skin="Web20"  
            Width="100%" 
            EnableAJAX="true"
            ShowStatusBar="True"   
            AutoGenerateColumns="False"
            AllowSorting="True"            
            AllowMultiColumnSorting="true"
            
            PageSize="100" 
            AllowPaging="True"
            AllowMultiRowEdit="false" 
            AllowAutomaticUpdates="True"  
            onprerender="Gridview1_PreRender" 
            onitemcommand="Gridview1_ItemCommand" EnableViewState="true" 
            >
            
             <headercontextmenu enabletheming="True" skin="Web20">
                 <collapseanimation duration="200" type="OutQuint" />
             </headercontextmenu>
            
             <ExportSettings>
                <Pdf FontType="Subset" PaperSize="Letter" />
                <Excel Format="Html"  />
                <Csv ColumnDelimiter="Colon" RowDelimiter="NewLine" />
               
            </ExportSettings>
            
             <filtermenu enabletheming="True" skin="Web20">
                 <collapseanimation duration="200" type="OutQuint" />
             </filtermenu>
             <EditItemStyle BackColor="#FFFFE1" />
            
            <SortingSettings SortedBackColor="Azure"  />
                        
             <AlternatingItemStyle BackColor="#FFFFE1" Font-Size="XX-Small" Wrap="true"  />
             <ItemStyle BackColor="#FFFFE1" Font-Size="XX-Small" Wrap="true" />
                        
            <PagerStyle Mode="NextPrevAndNumeric" />
                       
            <MasterTableView  EnableColumnsViewState="true"     
                DataKeyNames="ID" 
                EditMode="EditForms" 
                AutoGenerateColumns="false"   
                ShowHeadersWhenNoRecords="true" ShowHeader="true"  
                 DataSourceID="NotificationTemplatesDataSource"
                 EnableViewState="true" AllowSorting="true" CommandItemDisplay="TopAndBottom" >
                   
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>

                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>

                <Columns>
                    
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  Visible="true"  CancelText="Cancel"    >                
                        <ItemStyle Width="100px" ></ItemStyle>
                    </telerik:GridEditCommandColumn>
                                          
                    <telerik:GridBoundColumn UniqueName="Description" DataField="Description" 
                          HeaderText="Description" ReadOnly="false"    >                
                        <ItemStyle Width="700px"  Wrap="true" ></ItemStyle>  
                    </telerik:GridBoundColumn>  

                    <telerik:GridBoundColumn UniqueName="DefaultSubject" DataField="DefaultSubject" 
                          HeaderText="DefaultSubject" ReadOnly="false"    >                
                        <ItemStyle Width="200px"  Wrap="true" ></ItemStyle>  
                    </telerik:GridBoundColumn>  
                    
                    <telerik:GridBoundColumn UniqueName="DefaultFrom" DataField="DefaultFrom" 
                          HeaderText="DefaultFrom" ReadOnly="false"    >                
                        <ItemStyle Width="200px"  Wrap="true" ></ItemStyle>  
                    </telerik:GridBoundColumn>  
                    
                    <telerik:GridBoundColumn UniqueName="DefaultTo" DataField="DefaultTo" 
                          HeaderText="DefaultTo" ReadOnly="false"    >                
                        <ItemStyle Width="200px"  Wrap="true" ></ItemStyle>  
                    </telerik:GridBoundColumn>  

                    <telerik:GridBoundColumn UniqueName="EmailType" DataField="EmailType" 
                          HeaderText="EmailType" ReadOnly="false"    >                
                        <ItemStyle Width="200px"  Wrap="true"  ></ItemStyle>  
                    </telerik:GridBoundColumn>  
        
                    <telerik:GridBoundColumn UniqueName="DefaultAttachmentName" DataField="DefaultAttachmentName" 
                          HeaderText="DefaultAttachmentName" ReadOnly="false"    >                
                        <ItemStyle Width="200px"  Wrap="true" ></ItemStyle>  
                    </telerik:GridBoundColumn>  
                                                                             
                  </Columns>


                <EditFormSettings ColumnNumber="2" CaptionDataField="JobName" CaptionFormatString="Edit properties of Email Template {0}"
                        EditFormType="Template" >
                        
                    <EditColumn ButtonType="ImageButton"   
                        InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    
                    
                    <FormTableStyle BackColor="White" CellPadding="2" CellSpacing="0" 
                        Height="110px" />
                    <FormMainTableStyle BackColor="White" CellPadding="3" CellSpacing="0" 
                        GridLines="None" Width="100%" />
                    <FormCaptionStyle CssClass="EditFormHeader" />
                    <FormTableItemStyle Wrap="true" />
                    <FormTableAlternatingItemStyle Wrap="False" />
                    
                    
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                    
                    <FormTemplate >
                 
                        <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                            style="border-collapse: collapse;background:white;">
                            <tr class="EditFormHeader">
                                <td colspan="2" style="font-size: small">
                                    <b>Email Template Details</b></td>
                            </tr>

                            <tr >
                                <td valign="top" >
                                    <table id="Table3" cellspacing="1" cellpadding="1"  border="0" class="module">
                                        <tr>
                                            <td>
                                                ID:</td>
                                            <td>
                                                <asp:TextBox ID="IDTextBox" runat="server"  Width="300px" Text='<%# Bind( "ID" ) %>'>
                                                </asp:TextBox></td>
                                        </tr> 
                                        <tr>
                                            <td  >
                                                <b>Description:</b></td>
                                            <td>
                                                <asp:TextBox ID="TextBox1" runat="server"  Width="300px" Text='<%# Bind( "Description" ) %>'>
                                                </asp:TextBox></td>                                                
                                        </tr>
                                        <tr>
                                            <td>
                                                Default&nbsp;Subject:</td>
                                            <td>
                                                <asp:TextBox ID="DefaultSubjectTextBox" runat="server"  Width="300px" Text='<%# Bind( "DefaultSubject" ) %>'>
                                                </asp:TextBox></td>
                                        </tr>                                        
                                        <tr>
                                            <td>
                                                Default&nbsp;From:</td>
                                            <td>
                                                <asp:TextBox ID="DefaultFromTextBox" runat="server"  Width="300px" Text='<%# Bind( "DefaultFrom" ) %>' >
                                                </asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Default&nbsp;To:</td>
                                            <td> 
                                                <asp:TextBox ID="TextBox2" runat="server"  Width="300px" Text='<%# Bind( "DefaultTo" ) %>' 
                                                    Rows="3" Wrap="true" TextMode="MultiLine"  >
                                                </asp:TextBox> </td>
                                        </tr>

                                        <tr>
                                            <td>
                                                Notification&nbsp;Type:</td>
                                            <td> 

                                             <asp:DropDownList ID="NotificationTypeDropDownList" runat="server" SelectedValue='<%# Bind( "EmailType") %>'
                                                Width="175px" AutoPostBack="false">

                                                <asp:ListItem Value="Default">Default</asp:ListItem>
                                                <asp:ListItem Value="Custom">Custom</asp:ListItem>
                                                <asp:ListItem Value="Report">Report</asp:ListItem>
                                                <asp:ListItem Value="ReportExcel">ReportExcel</asp:ListItem>
                                                <asp:ListItem Value="OrganizationEmail">OrganizationEmail</asp:ListItem>
                                                <asp:ListItem Value="FutureDefault">FutureDefault</asp:ListItem> 
                                            </asp:DropDownList></td>
                                        </tr>                                          


                                        <tr>
                                            <td>
                                                Default&nbsp;Attachment&nbsp;Name:</td>
                                            <td> 
                                                <asp:TextBox ID="TextBox4" runat="server"  Width="300px" Text='<%# Bind( "DefaultAttachmentName" ) %>' >
                                                </asp:TextBox> </td>
                                        </tr>

                                        <tr>
                                            <td>
                                                Default&nbsp;Attachment&nbsp;Content:</td>
                                            <td> 
                                                <asp:TextBox ID="TextBox5" runat="server"  Width="300px" Text='<%# Bind( "DefaultAttachmentContentType" ) %>' >
                                                </asp:TextBox> </td>
                                        </tr>

                                        <tr>
                                            <td>
                                                Default&nbsp;Attachment&nbsp;Extension:</td>
                                            <td> 
                                                <asp:TextBox ID="TextBox6" runat="server"  Width="300px" Text='<%# Bind( "DefaultAttachmentFileExtension" ) %>' >
                                                </asp:TextBox> </td>
                                        </tr>
                                                                                
                                    </table>
                                </td>
                                <td valign="top">
                                    <table id="Table1" cellspacing="1" cellpadding="1"  border="0" class="module">
                                        <tr>
                                            
                                                                                    
                                            <td>
                                               Default&nbsp;Body:<br />
                                               
                                               <telerik:RadEditor id="DefaultBodyEditor" Runat=server content='<%# Bind( "DefaultBody" ) %>'
                                               Width="750px" 
                                               >
                                               </telerik:RadEditor>
                                            </td>
                                            <td></td>
                                        </tr>  
                                        <tr>
                                            <td align="right" colspan="2">

                                                 
                                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                </asp:Button>
                                                    
                                                <asp:Button ID="CancelButton" Text="<%$ Resources : Default,ButtonCancel %>" runat="server" CausesValidation="False"
                                                CommandName="Cancel"></asp:Button> 
                                                    
                                            </td>
                                        </tr>                                        
                                    </table>
                                </td>                                 
                            </tr>                             
                        </table>
                    <asp:Label ID="Messages" runat="server" Text="" ForeColor ="Green"></asp:Label>
                    <asp:Label ID="ErrorMessages" runat="server" Text="" ForeColor="Red"></asp:Label>

                    </FormTemplate>
                    
                </EditFormSettings>


            </MasterTableView>  
                 
        </telerik:RadGrid>        
        
        <!----------------------------------Data Source---------------------------------->
        <asp:ObjectDataSource ID="NotificationTemplatesDataSource" runat="server" SelectMethod="Select"  
             UpdateMethod="Update" TypeName="NotificationTemplatesDataSource" EnablePaging="False"
             DataObjectTypeName ="HITSWebService.NotificationTypeData"
             >
            
        </asp:ObjectDataSource>        
    </asp:Content>