Expand|Select|Wrap|Line Numbers
- <asp:DetailsView ID="property_detail"
- DataSourceID="Details" AutoGenerateRows="false"
- AutoGenerateInsertButton="true"
- AutoGenerateEditButton="true"
- AutoGenerateDeleteButton="true"
- EmptyDataText="Please select a record."
- DataKeyNames="ServiceProfileCode, Organization" GridLines="Both"
- OnItemInserted="CustomerDetail_ItemInserted"
- OnItemInserting="CustomerDetail_ItemInserting"
- OnItemUpdated="CustomerDetail_ItemUpdated"
- OnItemUpdating="CustomerDetail_ItemUpdating"
- OnItemDeleted="CustomerDetail_ItemDeleted"
- runat="server">
- <HeaderStyle BackColor="Navy" ForeColor="White" />
- <RowStyle BackColor="White" />
- <AlternatingRowStyle BackColor="LightGray" />
- <EditRowStyle BackColor="LightCyan" />
- <Fields>
- <asp:BoundField DataField="ServiceProfileCode" HeaderText="ServiceProfileCode" />
- <asp:BoundField DataField="Organization" HeaderText="Organization" />
- </Fields>
- </asp:DetailsView>
- <asp:SqlDataSource ID="Details"
- ConnectionString=
- "<%$ ConnectionStrings:MyConnectionString %>"
- runat="server"
- SelectCommand="SELECT * FROM [OrganizationXServiceProfile]
- WHERE ([ServiceProfileCode] = @ServiceProfileCode and [Organization] = @Organization)"
- DeleteCommand="DELETE FROM [OrganizationXServiceProfile]
- WHERE [ServiceProfileCode] = @ServiceProfileCode and [Organization] = @Organization"
- InsertCommand="INSERT INTO [OrganizationXServiceProfile] ([ServiceProfileCode], [Organization])
- VALUES (@ServiceProfileCode, @Organization)"
- UpdateCommand="UPDATE [OrganizationXServiceProfile] SET [ServiceProfileCode] = @ServiceProfileCode,
- [Organization] = @Organization
- WHERE [ServiceProfileCode] = @ServiceProfileCodeOld and [Organization] = @OrganizationOld">
- <SelectParameters>
- <asp:ControlParameter ControlID="property_gv"
- Name="ServiceProfileCode" PropertyName="SelectedDataKey.Values[0]"
- Type="String" DefaultValue="1" />
- <asp:ControlParameter ControlID="property_gv"
- Name="Organization" PropertyName="SelectedDataKey.Values[1]"
- Type="String" DefaultValue="1" />
- </SelectParameters>
- <DeleteParameters>
- <asp:Parameter Name="ServiceProfileCode" Type="String" />
- <asp:Parameter Name="Organization" Type="String" />
- </DeleteParameters>
- <UpdateParameters>
- <asp:Parameter Name="Organization" Type="String" />
- <asp:Parameter Name="ServiceProfileCode" Type="String" />
- <asp:ControlParameter ControlID="property_gv"
- Name="ServiceProfileCodeOld" PropertyName="SelectedDataKey.Values[0]"
- Type="String" DefaultValue="1" />
- <asp:ControlParameter ControlID="property_gv"
- Name="OrganizationOld" PropertyName="SelectedDataKey.Values[1]"
- Type="String" DefaultValue="1" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="Organization" Type="String" />
- <asp:Parameter Name="ServiceProfileCode" Type="String" />
- </InsertParameters>
- </asp:SqlDataSource>
- protected void CustomerDetail_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
- {
- Details.UpdateParameters[2].DefaultValue = e.Keys[0].ToString();
- Details.UpdateParameters[3].DefaultValue = e.Keys[1].ToString();
- }