Advertisement
Guest User

Untitled

a guest
Feb 5th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 2.43 KB | None | 0 0
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/template.master" AutoEventWireup="true" CodeFile="adremservico.aspx.cs" Inherits="oficinas_prestacaoservico_adremservico" %>
  2.  
  3. <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  4. </asp:Content>
  5. <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  6.     <div class="col-md-6">
  7.         <h1>Adicionar Serviços</h1>
  8.         <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Nome" DataValueField="idServico">
  9.  
  10.         </asp:CheckBoxList>
  11.    
  12.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Servicos] WHERE idServico NOT IN (SELECT idServicoFK FROM OficinasHasServicos WHERE idOficinaFK=@idOficinaFK) ORDER BY [Nome]">
  13.             <SelectParameters>
  14.                 <asp:SessionParameter Name="idOficinaFK" SessionField="id" />
  15.             </SelectParameters>
  16.         </asp:SqlDataSource>
  17.         <asp:Button id="btn1" runat="server" text="test" OnClick="btn1_Click"/>
  18.     </div>
  19.         <div class="col-md-6">
  20.             <h1>Serviços Disponibilizados</h1>
  21.             <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" class="table col-md-6 col-lg-6">
  22.                 <Columns >
  23.                     <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
  24.                     <asp:CommandField ButtonType="Link" ShowDeleteButton="true"/>
  25.                 </Columns>
  26.  
  27.             </asp:GridView>
  28.            
  29.            
  30.             <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Servicos] WHERE idServico IN (SELECT idServicoFK FROM OficinasHasServicos WHERE idOficinaFK=@idOficinaFK) ORDER BY [Nome]" DeleteCommand="Delete from oficinashasservicos where idOficinaFK=@idOficina and idServicoFK=@idservico">
  31.                 <DeleteParameters>
  32.                     <asp:Parameter Name="idoficina" />
  33.                     <asp:Parameter Name="idservicos" />
  34.                 </DeleteParameters>
  35.                 <SelectParameters>
  36.                     <asp:SessionParameter Name="idOficinaFK" SessionField="id" />
  37.                 </SelectParameters>
  38.             </asp:SqlDataSource>
  39.            
  40.            
  41.         </div>
  42. </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement