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 88 89 90 91 92 93 94 95 96 97 98
| <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Librairies" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:HiddenField ID="activeTab" runat="server" />
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
<asp:TabContainer ID="TabContainer1" runat="server" OnClientActiveTabChanged="ActiveTabChanged">
<script type="text/javascript">
function ActiveTabChanged(sender, e) {
var activeTab = $get('<%=activeTab.ClientID%>');
activeTab.value = sender.get_activeTabIndex();
}
</script>
<asp:TabPanel ID = "tbCategorie" runat = "server" HeaderText = "Categories">
<HeaderTemplate>Catégories</HeaderTemplate>
<ContentTemplate>
<div>
<asp:SqlDataSource ID="sqldsCategories" runat="server" ConnectionString="<%$ ConnectionStrings:ASSURANCEConnectionString %>"
SelectCommand="selectCategorie"
SelectCommandType="StoredProcedure"
UpdateCommand = "updateCategorie"
UpdateCommandType="StoredProcedure"
InsertCommand = "insertCategorie"
InsertCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name= "Categorie" Type="String" />
<asp:Parameter Name = "idCategorie" Type = "Int16" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name= "Categorie" Type="String" />
<asp:Parameter Name = "idCategorie" Type = "Int16" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTitle" runat="server" Text="Categories" BackColor="lightblue" Width="50%" />
<asp:GridView
ID="gvCategories" runat="server" DataKeyNames="idCategorie" AutoGenerateColumns="false"
AllowPaging="true" AllowSorting="true" PageSize="10" DataSourceID="sqldsCategories" Width="50%">
<AlternatingRowStyle BackColor="lightblue" />
<HeaderStyle HorizontalAlign="Left" />
<Columns>
<asp:TemplateField >
<ItemTemplate>
<asp:ImageButton ID="btnViewDetails" runat="server" OnClick="BtnViewDetails_Click" ImageUrl="~/images/btn_edit.gif"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="idCategorie" HeaderText="ID" SortExpression="idCategorie" ReadOnly="true" />
<asp:BoundField DataField="Categorie" HeaderText="Categorie" SortExpression="Categorie" ReadOnly="true" />
</Columns>
</asp:GridView>
<asp:LinkButton ID="lkAjouter" runat="server" OnClick="lkAjouter_Click">Ajouter</asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button id="btnShowPopup" runat="server" style="display:none" />
<asp:ModalPopupExtender
ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlPopup"
CancelControlID="btnClose" BackgroundCssClass="modalBackground" />
<asp:Panel ID="pnlPopup" runat="server" style="display:none; Width:80%" CssClass="modalBox" >
<asp:UpdatePanel ID="updPnlCategorieDetail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<br />
<asp:Panel ID="PersonCaption" runat="server" CssClass="caption" Style="margin-bottom: 10px; cursor: hand;">Detail Categorie</asp:Panel>
<asp:HiddenField ID="hidCategorieEditIndex" runat="server" Value="-1" />
<div class="divCol"> Categorie :</div>
<div class="divColLast">
<asp:TextBox ID="txtCategorie" runat="server" MaxLength="64" Width="250" ></asp:TextBox>
</div>
<div class="clearer"></div>
</ContentTemplate>
</asp:UpdatePanel>
<div style="width:50%;">
<asp:Button ID="btnSave" runat="server" OnClientClick="btnSave_Click" Text="Save"
Width="50px" OnClick="btnSave_Click" />
<asp:Button ID="btnClose" runat="server" Text="Close" Width="50px" />
</div>
</asp:Panel>
</div>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</asp:Content> |
Partager