<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" CodeBehind="CarrierEmailAttachments.aspx.cs" 
    Inherits="WebSite.site.HITS.Organization.CarrierEmailAttachments" Title="Brightstar Device Protection: Carrier Email Attachments" %>

<%@ Register Src="~/Controls/CustomSorter.ascx" TagName="CustomSorter" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
         <script src="<%=ResolveClientUrl("~/script/jquery.colorbox-min.js")%>" type="text/javascript"></script>
	<h1>Carrier Email Attachments</h1>
    <div class="greyblock" style="overflow: hidden">

        <script>
            function showattahcments() {
                $.colorbox({
                    inline: true, href: "#divEmailTemplates", title: "Associated Templates", width: "450px", height: "450px", retinaImage: true, retinaUrl: true, overlayClose: false
                });
            }
        </script>
		<style>
			#divEmailTemplates a{
			line-height: 20px;
			}
		</style>
    <asp:LinkButton ID="lbtnBackToCarrierDetails" runat="server" Text="<%$ Resources: OrganizationManagement, Back2CarrierDetailsLabel %>" Style="float: left;" OnClick="lbtnBackToCarrierDetails_Click"></asp:LinkButton>
</div>
    <div>
        <asp:UpdatePanel ID="UpdatePanel7" runat="server" UpdateMode="Always">
            <ContentTemplate>
			
				<div class="greyblock">
                <asp:Label runat="server" Text="File Name:"></asp:Label>
                
                <br />

                <asp:TextBox ID="txtAttachmentName" runat="server" Width="250px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvAttachmentName" runat="server" ControlToValidate="txtAttachmentName"
                    ErrorMessage='<%$ Resources: RapidsManagement, ErrorMessageRequired %>' Display="Dynamic"
                    ValidationGroup="UploadAttachment" EnableClientScript="false">
                </asp:RequiredFieldValidator>
                <asp:CustomValidator ID="cvFileUploadDuplicateFileName" runat="server" ControlToValidate="txtAttachmentName" ValidationGroup="UploadAttachment"
                    ErrorMessage="File Name must be unique." Display="Dynamic" OnServerValidate="cvFileUploadDuplicateFileName_ServerValidate">
                </asp:CustomValidator>
                <br />
                <br />

                <asp:Label runat="server" Text="Description:"></asp:Label>
                
                <br />

                <asp:TextBox ID="txtAttachmentDescription" runat="server" TextMode="MultiLine" Rows="3" Width="250px"></asp:TextBox>
                
                <br />
                <br />

                <asp:FileUpload ID="fuDocumentUpload" runat="server" Height="22px" Width="250px" />
                <span>
                    <asp:Label ID="m_lblFileSizeMax" runat="server" Text="2MB (MAX)" />
                </span>
                <asp:RequiredFieldValidator ID="rfvFileUpload" runat="server" ControlToValidate="fuDocumentUpload"
                    ErrorMessage='<%$ Resources: RapidsManagement, ErrorMessageRequired %>' Display="Dynamic"
                    ValidationGroup="UploadAttachment" EnableClientScript="false">
                </asp:RequiredFieldValidator>
                <asp:CustomValidator ID="cvFileUploadSize" runat="server" ControlToValidate="fuDocumentUpload" ValidationGroup="UploadAttachment"
                    ErrorMessage='<%$ Resources: RapidsManagement, ErrorMessageFileSizeExceeded %>' Display="Dynamic" OnServerValidate="cvFileUploadSize_ServerValidate">
                </asp:CustomValidator>
				<br />

                    <asp:Button ID="m_btnUploadDocument" runat="server" Text="Upload" Style="margin-top: 30px"
                    OnClick="m_btnUploadAttachment_Click" CausesValidation="true" ValidationGroup="UploadAttachment"></asp:Button>
                                
                <br />
                <br />

                </div>
                <asp:UpdateProgress ID="updProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel7">
                    <ProgressTemplate>
                        <asp:Panel ID="pnlProcessingImage" runat="server" HorizontalAlign="Left">
                            <asp:Image ID="imgProcessing" runat="server" ImageUrl="~/images/ajax-loader.gif" />
                            <asp:Label ID="lblProcessing" runat="server" Text='<%$ Resources: RapidsManagement, LabelProcessingRequest %>'></asp:Label>
                        </asp:Panel>
                    </ProgressTemplate>
                </asp:UpdateProgress>

            </ContentTemplate>
            <Triggers>
            <asp:PostBackTrigger ControlID="m_btnUploadDocument" />
        </Triggers>
        </asp:UpdatePanel>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <div style="display:none" >
			    <div id="divEmailTemplates">
				    <asp:Label runat="server" ID="emailAttachments"></asp:Label>
                </div>
            </div>

            <cc1:HitsSearchGridView ID="m_gvCompanyAttachments" runat="server" AutoGenerateColumns="False" AllowPaging="False"
                OnRowDataBound="m_gvCompanyAttachments_RowDataBound" OnMenuItemCommand="m_gvCompanyAttachments_MenuItemCommand"
                        class="gvTable gvCheckBoxTable" ClientFunctionDeActivateMessage="Warning: Deactivating this attachment will remove all assocaiated email template attachments."
                ShowMenu="True" ShowSelectField="True" AtlasScriptManagerID="" 
                ClientFunctionActivateSelected="" ClientFunctionDeActivateSelected="" CssClassCustomPaging="" CssClassMenu="" PropagateActionToChildID=""
                ShowActivateMenu="True" ShowDeActivateMenu="True" ShowDeSelectMenu="True"
                ShowEmailMenu="False" ShowDeleteMenu="False" ShowHotlineMenu="False" ShowDeHotlineMenu="False"
                ShowPrintMenu="False" ShowExportMenu="False"
                ClientFunctionSetStatus="" ShowSetStatus="False">
        
                <Columns>
                    <asp:TemplateField HeaderText="Attachment Id">
                        <ItemStyle width="50px" />
                        <ItemTemplate>
                            <asp:Literal runat="server" ID="m_litAttachmentId"></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="File Name">
                        <ItemStyle width="50px" />
                        <ItemTemplate>
                            <asp:Label ID="m_lblAttachmentName" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Description">
                        <ItemStyle width="150px" />
                        <ItemTemplate>
                            <asp:Label ID="m_lblAttachmentDescription" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Attachment">
                                <ItemStyle Width="50px" />
                        <ItemTemplate>
                            <asp:ImageButton ID="m_ibtnAttachment" runat="server" ImageUrl="~/Images/document_plain.png" />
                            <asp:Label ID="m_lblAttachmentId" runat="server" Visible="False" /> 
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Create Date">
                        <ItemStyle width="50px" />
                        <ItemTemplate>
                            <asp:Label ID="m_lblCreateDate" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Active">
                                <ItemStyle Width="50px" />
                        <ItemTemplate>
                            <asp:Label ID="m_lblInactiveDate" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Linked Templates">
                        <ItemStyle Width="50px" />
                        <ItemTemplate>
                            <asp:LinkButton ID="m_lbTemplates" runat="server" OnClick="m_lbTemplates_OnClick" Visible="false">Templates</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>

                <RowStyle HorizontalAlign="Left" VerticalAlign="Top" />
                <EditRowStyle HorizontalAlign="Left" VerticalAlign="Top" />
            </cc1:HitsSearchGridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>