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
|
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceTableCreationTemp" DataKeyNames="id, idSiteAssocie" DataMember="DefaultView" style="position: static" Width="754px">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField HeaderText="IdSite" InsertVisible="False" SortExpression="IdSite">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSourceSites"
DataTextField="NomSite" DataValueField="IdSite" Style="position: relative" SelectedValue='<%# Bind("IdSite") %>' AutoPostBack="True" >
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSourceSites" runat="server" ConnectionString="<%$ ConnectionStrings:ToIPManagerConnectionString %>"
SelectCommand="SELECT [NomSite], [IdSite] FROM [Site]"></asp:SqlDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("NomSite") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IdService" SortExpression="IdService">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSourceServices"
DataTextField="NomService" DataValueField="IdService"
Style="position: relative" SelectedValue='<%# Bind("IdService") %>' >
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSourceServices" runat="server" ConnectionString="<%$ ConnectionStrings:ToIPManagerConnectionString %>"
SelectCommand="SELECT * FROM [Service] WHERE ([idSiteAssocie] = @idSiteAssocie)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="idSiteAssocie" PropertyName="SelectedValue" Type="Int32"/>
</SelectParameters>
</asp:SqlDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("NomService") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nom" HeaderText="Nom" SortExpression="Nom" />
<asp:BoundField DataField="Prenom" HeaderText="Prenom" SortExpression="Prenom" />
<asp:BoundField DataField="DN" HeaderText="DN" SortExpression="DN" Visible="False" />
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:BoundField DataField="idSiteAssocie" HeaderText="idSiteAssocie" SortExpression="idSiteAssocie" />
</Columns>
<RowStyle BackColor="#E3EAEB" />
<EditRowStyle BackColor="#7C6F57" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSourceTableCreationTemp" runat="server" ConnectionString="<%$ ConnectionStrings:ToIPManagerConnectionString %>"
SelectCommand="SELECT CreationTemp.id, CreationTemp.IdSite, CreationTemp.IdService, CreationTemp.Nom, CreationTemp.Prenom, CreationTemp.DN, Site.NomSite, Site.Description, Site.IdSite AS Expr1, Service.IdService AS Expr2, Service.NomService, Service.Description AS Expr3, Service.idSiteAssocie FROM CreationTemp INNER JOIN Site ON CreationTemp.IdSite = Site.IdSite INNER JOIN Service ON Site.IdSite = Service.idSiteAssocie AND CreationTemp.IdService = Service.IdService"
UpdateCommand="UPDATE CreationTemp SET IdSite = @IdSite, IdService = @IdService, Nom = @Nom, Prenom = @Prenom WHERE (id = @id);"
DeleteCommand="DELETE FROM CreationTemp WHERE id = @id ;"
InsertCommand="INSERT INTO CreationTemp(Site, Service, Nom, Prenom) VALUES ('0','0', 'Nom', 'Prénom');">
<UpdateParameters>
<asp:Parameter Name="IdSite"/>
<asp:Parameter Name="IdService" DefaultValue="0"/>
<asp:Parameter Name="Nom" />
<asp:Parameter Name="Prenom" />
<asp:Parameter Name="id" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="id" />
</DeleteParameters>
</asp:SqlDataSource> |
Partager