1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
   |  
<table>
    <tr>
        <td valign="top">
 
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="id_mail" DataSourceID="Mails" PageSize="40">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="id_mail" HeaderText="id_mail" InsertVisible="False" ReadOnly="True" SortExpression="id_mail" />
                    <asp:BoundField DataField="name_mail" HeaderText="name_mail" SortExpression="name_mail" />
                    <asp:BoundField DataField="subject_mail" HeaderText="subject_mail" SortExpression="subject_mail" />
                </Columns>
                <HeaderStyle BackColor="SteelBlue" ForeColor="White" />
                <SelectedRowStyle BackColor="#E0E0E0" />
            </asp:GridView>
            <asp:SqlDataSource ID="Mails" runat="server" ConnectionString="<%$ ConnectionStrings:AutoResponderConnectionString %>"
                SelectCommand="SELECT [id_mail], [name_mail], [subject_mail] FROM [Mail_Template] ORDER BY [id_mail]">
            </asp:SqlDataSource>
        </td>
        <td valign="top" style="padding-left:5px; width: 392px;">
 
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="id_mail" DataSourceID="mails_details" Height="50px" Width="227px" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" AutoGenerateInsertButton="True" OnItemUpdated="DetailsView1_ItemUpdated" OnItemDeleted="DetailsView1_ItemDeleted" OnItemUpdating="DetailsView1_ItemUpdating">
                <Fields>
                    <asp:BoundField DataField="id_mail" HeaderText="id_mail" InsertVisible="False" ReadOnly="True" SortExpression="id_mail" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="name_mail" HeaderText="name_mail" SortExpression="name_mail" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="path_mail_templateHTML" HeaderText="path_mail_templateHTML" SortExpression="path_mail_templateHTML" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="path_mail_templateTXT" HeaderText="path_mail_templateTXT" SortExpression="path_mail_templateTXT" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="subject_mail" HeaderText="subject_mail" SortExpression="subject_mail" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:CheckBoxField DataField="priority" HeaderText="priority" SortExpression="priority">
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:CheckBoxField>
                    <asp:BoundField DataField="reply_address" HeaderText="reply_address" SortExpression="reply_address" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="from_address" HeaderText="from_address" SortExpression="from_address" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="reply_name" HeaderText="reply_name" SortExpression="reply_name" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="from_name" HeaderText="from_name" SortExpression="from_name" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                    <asp:BoundField DataField="path_mail_attachment" HeaderText="path_mail_attachment" SortExpression="path_mail_attachment" >
                        <HeaderStyle BackColor="SlateGray" ForeColor="White" Font-Bold="True" />
                    </asp:BoundField>
                </Fields>
                <HeaderStyle BackColor="LightBlue" ForeColor="White" />
            </asp:DetailsView>
            <asp:SqlDataSource ID="mails_details" runat="server" ConnectionString="<%$ ConnectionStrings:AutoResponderConnectionString %>"
                SelectCommand="SELECT * FROM Mail_template WHERE id_mail=@id_mail" UpdateCommand="UPDATE Mail_Template SET [name_mail] = @name_mail WHERE [id_mail] = @id_mail" DeleteCommand="DELETE FROM Composed_by WHERE id_mail=@id_mail; DELETE FROM Stats WHERE id_mail=@id_mail; DELETE FROM Mail_Template WHERE id_mail=@id_mail; " InsertCommand="INSERT INTO Mail_template (name_mail, path_mail_templateHTML, path_mail_templateTXT, subject_mail, priority, reply_address, from_address, reply_name, from_name, path_mail_attachment) VALUES (@name_mail, @path_mail_templateHTML, @path_mail_templateTXT, @subject_mail, @priority, @reply_address, @from_address, @reply_name, @from_name, @path_mail_attachment)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="id_mail" PropertyName="SelectedValue" Type="String" DefaultValue="1" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="name_mail" Type="String" />
                    <asp:Parameter Name="id_mail" Type="String"/>
                </UpdateParameters>
                <DeleteParameters>
                    <asp:Parameter Name="id_mail" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="name_mail" />
                    <asp:Parameter Name="path_mail_templateHTML" />
                    <asp:Parameter Name="path_mail_templateTXT" />
                    <asp:Parameter Name="subject_mail" />
                    <asp:Parameter Name="priority" />
                    <asp:Parameter Name="reply_address" />
                    <asp:Parameter Name="from_address" />
                    <asp:Parameter Name="reply_name" />
                    <asp:Parameter Name="from_name" />
                    <asp:Parameter Name="path_mail_attachment" />
                </InsertParameters>
            </asp:SqlDataSource>
            <asp:Label ID="Label1" runat="server" Height="132px" Text="Label" Width="337px"></asp:Label></td>
    </tr>
</table> | 
Partager