Solved

DetailView controls no longer update when I call .ItemUpdate method.

Posted on 2009-07-08
6
387 Views
Last Modified: 2012-05-07
I have a page with multiple DetailViews that used to update just fine when I called the ItemUpdate method.  The are all on asp:View controls in a MultiView.  I added a few more View controls with other controls on them and now none of the DetailViews update properly. When I check in the ItemUpdating event, the NewValues array does NOT contain the new values I am entering (and can clearly see) on the form.  

I can cut and paste any  of the Views containing the DetailView with it's DataSources onto a  separate .aspx page and it updates just as advertised.  I am wondering if I am running up against some limit in the ViewState or something.  Anyone with any experience along these lines?  
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register assembly="EOMaintWebLibrary" namespace="EOMaint" tagprefix="cc1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>The Pumphouse!</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
 
</head>
<body >
    <form id="form1" runat="server">
    
  
    
    <asp:Panel id="frame" runat="server">
      
        <div id="maintitle" style="left: 0px; top: 0px">
            <img alt="" src="pump.gif" width="57" height="80" />
            <img alt="The Pumphouse" src="title.gif" width="350" height="80" />
            <img alt="" src="pump.gif" width="57" height="80" />
        </div> 
            
        <div class="titlespacer">&nbsp;</div>        
        
         <asp:Panel ID="udpMain" runat="server">            
        
            <div id="header">
            <asp:GridView ID="LocationGrid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                DataSourceID="LocationGridData" PageSize="8" Width="680px" 
                DataKeyNames="FuncLoc" 
                OnSelectedIndexChanged="LocationGrid_SelectedIndexChanged" SelectedIndex="1" 
                RowHeaderColumn="FuncLoc" CssClass="grids" >
                <RowStyle BackColor="#EEEB9C" />
                <Columns>
                    <asp:CommandField ButtonType="Button" ShowSelectButton="True">
                        <HeaderStyle Width="70px" />
                        <ControlStyle CssClass="data" />
                    </asp:CommandField>
                    <asp:BoundField DataField="FuncLoc" HeaderText="Functional Location" ReadOnly="True"
                        SortExpression="FuncLoc">
                        <HeaderStyle Width="250px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                </Columns>
                <PagerStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" />
                <HeaderStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" Height="20px" />
                <SelectedRowStyle BackColor="YellowGreen" />                
            </asp:GridView>
                          
            <div id="MenuDiv" >
                <asp:Button ID="buttonListMaint" runat="server" Text="List Maint" 
                    CssClass="data" OnClick="buttonListMaint_Click" Width="90px" 
                    UseSubmitBehavior="False" /><br />
                <asp:Button ID="buttonTransactions" runat="server" Text="Transactions" 
                    CssClass="data" OnClick="buttonTransactions_Click" Width="90px" 
                    UseSubmitBehavior="False" /><br />
                <br />
                <asp:Button ID="reportButton" runat="server" CssClass="data" OnClick="reportButton_Click"
                    Text="Data Sheets" UseSubmitBehavior="False" />
                <asp:Button ID="buttonDataForm" runat="server" CssClass="data" OnClick="buttonDataForm_Click"
                    Text="Blank Sheet" UseSubmitBehavior="False" />
                <asp:Button ID="buttonList" runat="server" CssClass="data" OnClick="buttonList_Click"
                    Text="Filtered List" UseSubmitBehavior="False" />
            </div>
           <br /> 
                
            <asp:SqlDataSource ID="LocationGridData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                SelectCommand="SELECT [FuncLoc], [Description], [CostCenter], [SortField], [PumpModel], [PumpPrimaryLiquid], [LongText] FROM [PumpLocations]" DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" InsertCommand="INSERT INTO [PumpLocations] ([FuncLoc], [Description], [CostCenter], [SortField], [PumpModel], [PumpPrimaryLiquid], [LongText]) VALUES (@FuncLoc, @Description, @CostCenter, @SortField, @PumpModel, @PumpPrimaryLiquid, @LongText)" UpdateCommand="UPDATE [PumpLocations] SET [Description] = @Description, [CostCenter] = @CostCenter, [SortField] = @SortField, [PumpModel] = @PumpModel, [PumpPrimaryLiquid] = @PumpPrimaryLiquid, [LongText] = @LongText WHERE [FuncLoc] = @FuncLoc" >
            </asp:SqlDataSource>
           
            
            <asp:TextBox ID="textboxCriteria" runat="server" CssClass="data" Width="300px"></asp:TextBox>
            <asp:Button ID="searchButton" runat="server" CssClass="data" Text="Filter by Keyword / FL" Width="160px" OnClick="searchButton_Click" />&nbsp;<asp:Button
                        ID="buttonFilterReset" runat="server" CssClass="data" OnClick="buttonFilterReset_Click"
                        Text="Remove Filter" />
            <asp:Label ID="labelRowCount" runat="server"></asp:Label>
        </div> 
 
            <div class="titlespacer">&nbsp;</div>        
     
            <table width="100%">
            <tr><td>
            <div id="main">            
           
            
                <asp:Panel ID="statusPanel" CssClass="status" runat="server" >
                    <asp:Label ID="statusLabel" runat="server" Text=""></asp:Label>
                </asp:Panel> 
                
                <div id="tabs" >              
                    <asp:Button ID="locationButton" runat="server" CssClass="tab" Text="Location" 
                        OnClick="locationButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="pumpButton" runat="server" CssClass="tab" Text="Pump" 
                        OnClick="pumpButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="motorButton" runat="server" CssClass="tab" Text="Motor" 
                        OnClick="motorButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="sealButton" runat="server" CssClass="tab" Text="Seal" 
                        OnClick="sealButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="driveButton" runat="server" CssClass="tab" Text="Drive" 
                        OnClick="driveButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="processButton" runat="server" CssClass="tab" 
                        OnClick="processButton_Click" Text="Process" ValidationGroup="Tabs" />
                    <asp:Button ID="bomButton" runat="server" CssClass="tab" Text="BOM" 
                        OnClick="bomButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="docsButton" runat="server" CssClass="tab" Text="Docs" 
                        OnClick="docsButton_Click" ValidationGroup="Tabs" />
                    <asp:Button ID="pixButton" runat="server" CssClass="tab" Text="Picture" 
                    OnClick="pixButton_Click" ValidationGroup="Tabs" />
                </div>
                          
                
                <asp:MultiView ID="mvMain" runat="server">
                
                    <asp:View ID="vwLocation" runat="server" EnableViewState="False">
                        <asp:Panel ID="locationPanel" runat="server" CssClass="detailpanel" >
                            <asp:DetailsView ID="PumpLocationView" runat="server" AutoGenerateRows="False" 
                                DataSourceID="PumpLocations" Width="100%" BorderColor="Black" 
                                BorderStyle="Solid" BorderWidth="1px" DataKeyNames="FuncLoc" 
                                EmptyDataText="No records meeting filter criteria, change or remove criteria and re-filter." >
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Functional Location" SortExpression="FuncLoc">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditFL" runat="server" Text='<%# Bind("FuncLoc") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtNewFL" runat="server" Text='<%# Bind("FuncLoc") %>'
                                                CssClass="data" OnTextChanged="txtNewFL_TextChanged" Width="316px"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemFL" runat="server" Text='<%# Bind("FuncLoc") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Description" SortExpression="Description">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditDesc" runat="server" CssClass="data" Text='<%# Bind("Description") %>'
                                                Width="400px"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtInsertDesc" runat="server" CssClass="data" Text='<%# Bind("Description") %>'
                                                Width="400px" Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Sort Field" SortExpression="SortField">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditEqNo" runat="server" CssClass="data" 
                                                Text='<%# Bind("SortField") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtInsertEqNo" runat="server" CssClass="data" 
                                                Text='<%# Bind("SortField") %>' Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("SortField") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="150px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Condition">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList9" runat="server" CssClass="data" DataSourceID="ConditionData"
                                                DataTextField="Condition" DataValueField="ConditionID" SelectedValue='<%# Bind("ConditionID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList9" runat="server" CssClass="data" DataSourceID="ConditionData"
                                                DataTextField="Condition" DataValueField="ConditionID" SelectedValue='<%# Bind("ConditionID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList9" runat="server" CssClass="data" DataSourceID="ConditionData"
                                                DataTextField="Condition" DataValueField="ConditionID" Enabled="False" SelectedValue='<%# Bind("ConditionID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="ABC Indicator" SortExpression="ABCIndicator">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" Text='<%# Bind("ABCIndicator") %>'
                                                Width="80px"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" Text='<%# Bind("ABCIndicator") %>'
                                                Width="80px" Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("ABCIndicator") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Catalog Profile" SortExpression="CatalogProfile">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("CatalogProfile") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("CatalogProfile") %>' CssClass="data" Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("CatalogProfile") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cost Center" SortExpression="CostCenter">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditCC" runat="server" Text='<%# Bind("CostCenter") %>' 
                                                CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtInsertCC" runat="server" Text='<%# Bind("CostCenter") %>' 
                                                CssClass="data" Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("CostCenter") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Long Text" SortExpression="LongText">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" Height="95px" Text='<%# Bind("LongText") %>'
                                                Width="400px" TextMode="MultiLine"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" CssClass="data" Height="95px" Text='<%# Bind("LongText") %>'
                                                Width="400px" TextMode="MultiLine" Enabled="False"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("LongText") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Entry Form Complete?" SortExpression="DataEntryForm">
                                        <EditItemTemplate>
                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("DataEntryForm") %>'
                                                CssClass="data" />
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("DataEntryForm") %>'
                                                CssClass="data" />
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("DataEntryForm") %>'
                                                CssClass="data" Enabled="False" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField HeaderText="Comment" SortExpression="Comment">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Comment") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Comment") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Comment") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                                </Fields>
                                <PagerSettings Mode="NumericFirstLast" />
                                <PagerStyle BackColor="Khaki" />
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                                <EmptyDataRowStyle BackColor="#EEEB9C" Height="25px" />
                            </asp:DetailsView>
                            <asp:SqlDataSource ID="ConditionData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [ConditionID], [Condition] FROM [Conditions]"></asp:SqlDataSource>
                            
                            
                            <asp:SqlDataSource ID="PumpLocations" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                              SelectCommand="SELECT SortField, ABCIndicator, CatalogProfile, CostCenter, LongText, Description, FuncLoc, DataEntryForm, Comment, ConditionID FROM PumpLocations WHERE (FuncLoc = @FuncLoc)" 
                              DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" 
                              InsertCommand="INSERT INTO PumpLocations(SortField, ABCIndicator, CatalogProfile, CostCenter, LongText, Description, FuncLoc, DataEntryForm, ConditionID, Comment ) VALUES (@SortField, @ABCIndicator, @CatalogProfile, @CostCenter, @LongText, @Description, @FuncLoc, @DataEntryForm, @ConditionID, @Comment )" 
                              
                                UpdateCommand="UPDATE PumpLocations SET SortField = @SortField, ABCIndicator = @ABCIndicator, CatalogProfile = @CatalogProfile, CostCenter = @CostCenter, LongText = @LongText, Description = @Description, DataEntryForm = @DataEntryForm, ConditionID = @ConditionID, Comment = @Comment WHERE (FuncLoc = @FuncLoc)"  >
                              <SelectParameters>
                                  <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                      Type="String" />
                              </SelectParameters>
                              <DeleteParameters>
                                  <asp:Parameter Name="FuncLoc" Type="String" />
                              </DeleteParameters>
                              <UpdateParameters>
                                  <asp:Parameter Name="SortField" Type="String" />
                                  <asp:Parameter Name="ABCIndicator" Type="String" />
                                  <asp:Parameter Name="CatalogProfile" Type="String" />
                                  <asp:Parameter Name="CostCenter" Type="String" />
                                  <asp:Parameter Name="LongText" Type="String" />
                                  <asp:Parameter Name="Description" Type="String" />
                                  <asp:Parameter Name="DataEntryForm" />
                                  <asp:Parameter Name="ConditionID" />
                                  <asp:Parameter Name="Comment" />
                                  <asp:Parameter Name="FuncLoc" Type="String" />
                              </UpdateParameters>
                              <InsertParameters>
                                  <asp:Parameter Name="SortField" Type="String" />
                                  <asp:Parameter Name="ABCIndicator" Type="String" />
                                  <asp:Parameter Name="CatalogProfile" Type="String" />
                                  <asp:Parameter Name="CostCenter" Type="String" />
                                  <asp:Parameter Name="LongText" Type="String" />
                                  <asp:Parameter Name="Description" Type="String" />
                                  <asp:Parameter Name="FuncLoc" Type="String" />
                                  <asp:Parameter Name="DataEntryForm" />
                                  <asp:Parameter Name="ConditionID" />
                                  <asp:Parameter Name="Comment" />
                              </InsertParameters>
                            </asp:SqlDataSource>                                  
                        </asp:Panel> 
                    </asp:View>
                    
                    <asp:View ID="vwPump" runat="server">
                        <asp:Panel ID="pumpPanel" runat="server" CssClass="detailpanel" >
                            <asp:SqlDataSource ID="PumpData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [PumpMfgID], [PumpTypeID], [PumpModel], [PumpSerialNo], [PumpImpellerSizeRange], [PumpCaseMaterial], [SuctionLineSize], [DischargeLineSize], [FuncLoc], [PumpSize], [ImpellerMaterial], [PumpWeight] FROM [PumpLocations] WHERE ([FuncLoc] = @FuncLoc)" 
                                DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" 
                                InsertCommand="INSERT INTO [PumpLocations] ([PumpMfgID], [PumpTypeID], [PumpModel], [PumpSerialNo], [PumpImpellerSizeRange], [PumpCaseMaterial],[SuctionLineSize], [DischargeLineSize], [FuncLoc], [PumpSize], [ImpellerMaterial], [Pumpweight]) VALUES (@PumpMfgID, @PumpTypeID, @PumpModel, @PumpSerialNo, @PumpImpellerSizeRange, @PumpCaseMaterial, @PumpCoupling, @SuctionLineSize, @DischargeLineSize, @FuncLoc, @PumpSize, @ImpellerMaterial, @PumpWeight)" 
                                UpdateCommand="UPDATE [PumpLocations] SET [PumpMfgID] = @PumpMfgID, [PumpTypeID] = @PumpTypeID, [PumpModel] = @PumpModel, [PumpSerialNo] = @PumpSerialNo, [PumpImpellerSizeRange] = @PumpImpellerSizeRange, [PumpCaseMaterial] = @PumpCaseMaterial, [SuctionLineSize] = @SuctionLineSize, [DischargeLineSize] = @DischargeLineSize, [PumpSize] = @PumpSize, [ImpellerMaterial]  = @ImpellerMaterial, [PumpWeight] = @PumpWeight WHERE [FuncLoc] = @FuncLoc">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="PumpMfgID" Type="Int16" />
                                    <asp:Parameter Name="PumpTypeID" Type="Int16" />
                                    <asp:Parameter Name="PumpModel" Type="String" />
                                    <asp:Parameter Name="PumpSerialNo" Type="String" />
                                    <asp:Parameter Name="PumpImpellerSizeRange" Type="String" />
                                    <asp:Parameter Name="PumpCaseMaterial" Type="String" />
                                    <asp:Parameter Name="SuctionLineSize" Type="String" />
                                    <asp:Parameter Name="DischargeLineSize" Type="String" />
                                    <asp:Parameter Name="PumpSize" />
                                    <asp:Parameter Name="ImpellerMaterial" />
                                    <asp:Parameter Name="PumpWeight" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="PumpMfgID" Type="Int16" />
                                    <asp:Parameter Name="PumpTypeID" Type="Int16" />
                                    <asp:Parameter Name="PumpModel" Type="String" />
                                    <asp:Parameter Name="PumpSerialNo" Type="String" />
                                    <asp:Parameter Name="PumpImpellerSizeRange" Type="String" />
                                    <asp:Parameter Name="PumpCaseMaterial" Type="String" />
                                    <asp:Parameter Name="PumpCoupling" Type="String" />
                                    <asp:Parameter Name="SuctionLineSize" Type="String" />
                                    <asp:Parameter Name="DischargeLineSize" Type="String" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                    <asp:Parameter Name="PumpSize" />
                                    <asp:Parameter Name="ImpellerMaterial" />
                                    <asp:Parameter Name="PumpWeight" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="PumpMfgData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [PumpMfgID], [PumpMfg] FROM [PumpMfgs] ORDER BY [PumpMfg]"></asp:SqlDataSource>
                            <asp:SqlDataSource ID="PumpTypeData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                 SelectCommand="SELECT [PumpTypeID], [PumpType] FROM [PumpTypes]"></asp:SqlDataSource>
                            <asp:DetailsView ID="PumpView" runat="server" AutoGenerateRows="False" DataSourceID="PumpData" Width="100%" 
                                BorderColor="Black"  BorderStyle="Solid" BorderWidth="1px" EmptyDataText="No Pump Data for this location." 
                                DataKeyNames="FuncLoc" OnItemUpdating="PumpView_ItemUpdating" OnDataBound="PumpView_DataBound" >                                
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Pump Manufacturer">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList1" runat="server" CssClass="data" DataSourceID="PumpMfgData"
                                                DataTextField="PumpMfg" DataValueField="PumpMfgID" SelectedValue='<%# Bind("PumpMfgID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList1" runat="server" CssClass="data" DataSourceID="PumpMfgData"
                                                DataTextField="PumpMfg" DataValueField="PumpMfgID" SelectedValue='<%# Bind("PumpMfgID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList1" runat="server" CssClass="data" DataSourceID="PumpMfgData"
                                                DataTextField="PumpMfg" DataValueField="PumpMfgID" Enabled="False" SelectedValue='<%# Bind("PumpMfgID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Type">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList2" runat="server" CssClass="data" DataSourceID="PumpTypeData"
                                                DataTextField="PumpType" DataValueField="PumpTypeID" SelectedValue='<%# Bind("PumpTypeID") %>' Enabled="False">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList2" runat="server" CssClass="data" DataSourceID="PumpTypeData"
                                                DataTextField="PumpType" DataValueField="PumpTypeID" SelectedValue='<%# Bind("PumpTypeID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList2" runat="server" CssClass="data" DataSourceID="PumpTypeData"
                                                DataTextField="PumpType" DataValueField="PumpTypeID" SelectedValue='<%# Bind("PumpTypeID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <HeaderStyle Width="150px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Model" SortExpression="PumpModel">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PumpModel") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PumpModel") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("PumpModel") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Serial No" SortExpression="PumpSerialNo">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PumpSerialNo") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PumpSerialNo") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("PumpSerialNo") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Size" SortExpression="PumpSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" Text='<%# Bind("PumpSize") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" Text='<%# Bind("PumpSize") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("PumpSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Weight" SortExpression="PumpWeight">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox9" runat="server" CssClass="data" Text='<%# Bind("PumpWeight") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox9" runat="server" CssClass="data" Text='<%# Bind("PumpWeight") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("PumpWeight") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Case Material" SortExpression="PumpCaseMaterial">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("PumpCaseMaterial") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("PumpCaseMaterial") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("PumpCaseMaterial") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Impeller Material" SortExpression="ImpellerMaterial">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("ImpellerMaterial") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("ImpellerMaterial") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("ImpellerMaterial") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Impeller Size" SortExpression="PumpImpellerSizeRange">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PumpImpellerSizeRange") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PumpImpellerSizeRange") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("PumpImpellerSizeRange") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Suction Line Size" SortExpression="SuctionLineSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("SuctionLineSize") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("SuctionLineSize") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("SuctionLineSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Discharge Line Size" SortExpression="DischargeLineSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DischargeLineSize") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DischargeLineSize") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("DischargeLineSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                                </Fields>
                                <EmptyDataRowStyle BackColor="#EEEB9C" />
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                            </asp:DetailsView>                             
                            
                            </asp:Panel>                            
                    </asp:View>
                    
                    <asp:View ID="vwMotor" runat="server">
                        <asp:Panel ID="motorPanel" runat="server" CssClass="detailpanel">
                            <asp:DetailsView ID="MotorView" runat="server" AutoGenerateRows="False"
                                DataSourceID="MotorData" Width="100%" BorderColor="Black" EmptyDataText="No Motor Data for this location." 
                                BorderStyle="Solid" BorderWidth="1px" DataKeyNames="FuncLoc" OnItemUpdating="MotorView_ItemUpdating" 
                                OnDataBound="MotorView_DataBound" >
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Motor Coupling Type" SortExpression="MotorCoupling">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList7" runat="server" CssClass="data" DataSourceID="MotorCouplingData"
                                                DataTextField="CouplingType" DataValueField="CouplingTypeID" SelectedValue='<%# Bind("MotorCouplingID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList7" runat="server" CssClass="data" DataSourceID="MotorCouplingData"
                                                DataTextField="CouplingType" DataValueField="CouplingTypeID" SelectedValue='<%# Bind("MotorCouplingID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList7" runat="server" CssClass="data" DataSourceID="MotorCouplingData"
                                                DataTextField="CouplingType" DataValueField="CouplingTypeID" Enabled="False"
                                                SelectedValue='<%# Bind("MotorCouplingID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Coupling Size" SortExpression="MotorCouplingSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" Text='<%# Bind("MotorCouplingSize") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" Text='<%# Bind("MotorCouplingSize") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("MotorCouplingSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Manufacturer" SortExpression="MotorMfgID">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList11" runat="server" CssClass="data" DataSourceID="MotorMfgData"
                                                DataTextField="MotorMfg" DataValueField="MotorMfgID" SelectedValue='<%# Bind("MotorMfgID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList11" runat="server" CssClass="data" DataSourceID="MotorMfgData"
                                                DataTextField="MotorMfg" DataValueField="MotorMfgID" SelectedValue='<%# Bind("MotorMfgID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList11" runat="server" CssClass="data" DataSourceID="MotorMfgData"
                                                DataTextField="MotorMfg" DataValueField="MotorMfgID" Enabled="False" SelectedValue='<%# Bind("MotorMfgID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor HP" SortExpression="MotorHP">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" CssClass="data" Text='<%# Bind("MotorHP") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" CssClass="data" Text='<%# Bind("MotorHP") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <HeaderStyle Width="150px" />
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("MotorHP") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Frame" SortExpression="MotorFrame">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" CssClass="data" Text='<%# Bind("MotorFrame") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" CssClass="data" Text='<%# Bind("MotorFrame") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("MotorFrame") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Weight" SortExpression="MotorWeight">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" Text='<%# Bind("MotorWeight") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" Text='<%# Bind("MotorWeight") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("MotorWeight") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Speed" SortExpression="MotorSpeed">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" Text='<%# Bind("MotorSpeed") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" Text='<%# Bind("MotorSpeed") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("MotorSpeed") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor Voltage" SortExpression="MotorVoltage">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" CssClass="data" Text='<%# Bind("MotorVoltage") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" CssClass="data" Text='<%# Bind("MotorVoltage") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("MotorVoltage") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Motor AC/DC" SortExpression="MotorACDC">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("MotorACDC") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("MotorACDC") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("MotorACDC") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="VFD?" SortExpression="VFD">
                                        <EditItemTemplate>
                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("VFD") %>' CssClass="data" />
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("VFD") %>' CssClass="data" />
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("VFD") %>' CssClass="data"
                                                Enabled="False" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                                </Fields>
                                <EditRowStyle BackColor="#EEEB9C" />
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                            </asp:DetailsView>
                            <asp:SqlDataSource ID="MotorData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [MotorHP], [MotorFrame], [MotorSpeed], [MotorVoltage], [MotorACDC], [FuncLoc], [MotorCouplingID], [MotorWeight], [MotorCouplingSize], [VFD], [MotorMfgID] FROM [PumpLocations] WHERE ([FuncLoc] = @FuncLoc)" DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" InsertCommand="INSERT INTO PumpLocations(MotorMfgID, MotorHP, MotorFrame, MotorSpeed, MotorVoltage, MotorACDC, MotorWeight, MotorCouplingID, MotorCouplingSize, VFD, MotorMfgID) VALUES (@MotorMfgID, @MotorHP, @MotorFrame, @MotorSpeed, @MotorVoltage, @MotorACDC, @MotorWeight, @MotorCouplingID, @MotorCouplingSize, @VFD, @MotorMfgID)" UpdateCommand="UPDATE [PumpLocations] SET [MotorHP] = @MotorHP, [MotorFrame] = @MotorFrame, [MotorSpeed] = @MotorSpeed, [MotorVoltage] = @MotorVoltage, [MotorACDC] = @MotorACDC,  [MotorCouplingID] = @MotorCouplingID, [MotorWeight] = @MotorWeight, [MotorCouplingSize]  = @MotorCouplingSize, [VFD] = @VFD, [MotorMfgID] = @MotorMfgID WHERE [FuncLoc] = @FuncLoc">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="MotorHP" Type="String" />
                                    <asp:Parameter Name="MotorFrame" Type="String" />
                                    <asp:Parameter Name="MotorSpeed" Type="String" />
                                    <asp:Parameter Name="MotorVoltage" Type="String" />
                                    <asp:Parameter Name="MotorACDC" Type="String" />
                                    <asp:Parameter Name="MotorCouplingID" />
                                    <asp:Parameter Name="MotorWeight" />
                                    <asp:Parameter Name="MotorCouplingSize" />
                                    <asp:Parameter Name="VFD" />
                                    <asp:Parameter Name="MotorMfgID" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="MotorMfgID" />
                                    <asp:Parameter Name="MotorHP" />
                                    <asp:Parameter Name="MotorFrame" />
                                    <asp:Parameter Name="MotorSpeed" />
                                    <asp:Parameter Name="MotorVoltage" />
                                    <asp:Parameter Name="MotorACDC" />
                                    <asp:Parameter Name="MotorWeight" />
                                    <asp:Parameter Name="MotorCouplingID" />
                                    <asp:Parameter Name="MotorCouplingSize" />
                                    <asp:Parameter Name="VFD" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="MotorCouplingData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [CouplingTypeID], [CouplingType] FROM [CouplingTypes]"></asp:SqlDataSource>
                            <asp:SqlDataSource ID="MotorMfgData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [MotorMfgID], [MotorMfg] FROM [MotorMfgs]"></asp:SqlDataSource>
                        </asp:Panel>
                    </asp:View>
                    
                    <asp:View ID="vwSeal" runat="server">
                        <asp:Panel ID="sealPanel" runat="server" CssClass="detailpanel" >
                            <asp:DetailsView ID="SealView" runat="server" AutoGenerateRows="False" 
                                DataSourceID="SealData" Width="100%" EmptyDataText="No Seal Data for this location." BorderColor="Black" ForeColor="Black" BorderStyle="Solid" BorderWidth="1px" DataKeyNames="FuncLoc" >
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Seal Type">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList4" runat="server" CssClass="data" DataSourceID="SealTypeData"
                                                DataTextField="SealType" DataValueField="SealTypeID" SelectedValue='<%# Bind("SealTypeID") %>' Enabled="False">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList4" runat="server" CssClass="data" DataSourceID="SealTypeData"
                                                DataTextField="SealType" DataValueField="SealTypeID" SelectedValue='<%# Bind("SealTypeID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList4" runat="server" CssClass="data" DataSourceID="SealTypeData"
                                                DataTextField="SealType" DataValueField="SealTypeID" SelectedValue='<%# Bind("SealTypeID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Mech Seal Mfg">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList3" runat="server" CssClass="data" DataSourceID="SealMfgData"
                                                DataTextField="SealMfg" DataValueField="SealMfgID" SelectedValue='<%# Bind("SealMfgID") %>' Enabled="False">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList3" runat="server" CssClass="data" DataSourceID="SealMfgData"
                                                DataTextField="SealMfg" DataValueField="SealMfgID" SelectedValue='<%# Bind("SealMfgID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList3" runat="server" CssClass="data" DataSourceID="SealMfgData"
                                                DataTextField="SealMfg" DataValueField="SealMfgID" SelectedValue='<%# Bind("SealMfgID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <HeaderStyle Width="150px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Mech Seal Model" SortExpression="SealModel">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("SealModel") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" Text='<%# Bind("SealModel") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("SealModel") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Mech Seal Serial No" SortExpression="SealSerialNo">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" Text='<%# Bind("SealSerialNo") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" Text='<%# Bind("SealSerialNo") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("SealSerialNo") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Mech Seal Size" SortExpression="SealSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SealSize") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SealSize") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("SealSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Packing Type" SortExpression="PackingType">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PackingType") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PackingType") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("PackingType") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Packing Size" SortExpression="PackingSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PackingSize") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PackingSize") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("PackingSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Packing Sequence" SortExpression="PackingSequence">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("PackingSequence") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("PackingSequence") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("PackingSequence") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                                </Fields>
                                <EmptyDataRowStyle BackColor="#EEEB9C" />
                                <EmptyDataTemplate>
                                    <asp:Panel ID="Panel1" runat="server" CssClass="emptydata" Height="50px" HorizontalAlign="Center"
                                        Width="100%">
                                    No Seal Data entered for this location...<br />
                                        <br />
                                        &nbsp;<asp:Button ID="newSealDataButton" runat="server" CssClass="data" OnClick="newSealDataButton_Click"
                                        Text="Add Seal Data" /></asp:Panel>
                                </EmptyDataTemplate>
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                            </asp:DetailsView>
                            <asp:SqlDataSource ID="SealTypeData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [SealTypeID], [SealType] FROM [SealTypes]">
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="SealMfgData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                    SelectCommand="SELECT [SealMfgID], [SealMfg] FROM [SealMfgs]">
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="SealData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [SealMfgID], [SealTypeID], [SealSize], [PackingType], [PackingSize], [PackingSequence], [FuncLoc], [SealModel], [SealSerialNo]  FROM [PumpLocations] WHERE ([FuncLoc] = @FuncLoc)" 
                                DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" 
                                InsertCommand="INSERT INTO [PumpLocations] ([SealMfgID], [SealTypeID], [SealSize], [PackingType], [PackingSize], [PackingSequence], [FuncLoc], [SealModel], [SealSerialNo]) VALUES (@SealMfgID, @SealTypeID, @SealSize, @PackingType, @PackingSize, @PackingSequence, @FuncLoc, SealModel, SealSerialNo)" 
                                UpdateCommand="UPDATE [PumpLocations] SET [SealMfgID] = @SealMfgID, [SealTypeID] = @SealTypeID, [SealSize] = @SealSize, [PackingType] = @PackingType, [PackingSize] = @PackingSize, [PackingSequence] = @PackingSequence, [SealModel] = @SealModel, [SealSerialNo] = @SealSerialNo  WHERE [FuncLoc] = @FuncLoc">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="SealMfgID" Type="Int16" />
                                    <asp:Parameter Name="SealTypeID" Type="Int16" />
                                    <asp:Parameter Name="SealSize" Type="String" />
                                    <asp:Parameter Name="PackingType" Type="String" />
                                    <asp:Parameter Name="PackingSize" Type="String" />
                                    <asp:Parameter Name="PackingSequence" Type="String" />
                                    <asp:Parameter Name="SealModel" />
                                    <asp:Parameter Name="SealSerialNo" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="SealMfgID" Type="Int16" />
                                    <asp:Parameter Name="SealTypeID" Type="Int16" />
                                    <asp:Parameter Name="SealSize" Type="String" />
                                    <asp:Parameter Name="PackingType" Type="String" />
                                    <asp:Parameter Name="PackingSize" Type="String" />
                                    <asp:Parameter Name="PackingSequence" Type="String" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </InsertParameters>
                            </asp:SqlDataSource>                            
                        </asp:Panel>       
                    </asp:View>
                    
                    <asp:View ID="vwDrive" runat="server">
                        <asp:Panel ID="drivePanel" runat="server" CssClass="detailpanel">
                            <asp:DetailsView ID="DriveView" runat="server" AutoGenerateRows="False" 
                                BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                DataKeyNames="FuncLoc" DataSourceID="DriveData" 
                                EmptyDataText="No Drive data for this locaton." Width="100%">
                                <EmptyDataRowStyle BackColor="#EEEB9C" />
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Reducer Coupling Type" 
                                        SortExpression="ReducerCoupling">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList8" runat="server" CssClass="data" 
                                                DataSourceID="ReducerCouplingData" DataTextField="CouplingType" 
                                                DataValueField="CouplingTypeID" 
                                                SelectedValue='<%# Bind("ReducerCouplingID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList8" runat="server" CssClass="data" 
                                                DataSourceID="ReducerCouplingData" DataTextField="CouplingType" 
                                                DataValueField="CouplingTypeID" 
                                                SelectedValue='<%# Bind("ReducerCouplingID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList8" runat="server" CssClass="data" 
                                                DataSourceID="ReducerCouplingData" DataTextField="CouplingType" 
                                                DataValueField="CouplingTypeID" Enabled="False" 
                                                SelectedValue='<%# Bind("ReducerCouplingID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Coupling Size" 
                                        SortExpression="ReducerCouplingSize">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerCouplingSize") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox8" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerCouplingSize") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("ReducerCouplingSize") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Manufacturer">
                                        <HeaderStyle Width="150px" />
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList5" runat="server" CssClass="data" 
                                                DataSourceID="ReducerMfgData" DataTextField="ReducerMfg" 
                                                DataValueField="ReducerMfgID" Enabled="False" 
                                                SelectedValue='<%# Bind("ReducerMfgID") %>'>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList5" runat="server" CssClass="data" 
                                                DataSourceID="ReducerMfgData" DataTextField="ReducerMfg" 
                                                DataValueField="ReducerMfgID" SelectedValue='<%# Bind("ReducerMfgID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList5" runat="server" CssClass="data" 
                                                DataSourceID="ReducerMfgData" DataTextField="ReducerMfg" 
                                                DataValueField="ReducerMfgID" SelectedValue='<%# Bind("ReducerMfgID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Model" SortExpression="Reducer Model">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerModel") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox6" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerModel") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("ReducerModel") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Serial No" 
                                        SortExpression="ReducerSerialNo">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerSerialNo") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerSerialNo") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <HeaderStyle Width="125px" />
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("ReducerSerialNo") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Ratio" SortExpression="ReducerRatio">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerRatio") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerRatio") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("ReducerRatio") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Reducer Weight" SortExpression="ReducerWeight">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerWeight") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" CssClass="data" 
                                                Text='<%# Bind("ReducerWeight") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("ReducerWeight") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Drive Sheave Diameter" 
                                        SortExpression="DriveSheaveDiameter">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" 
                                                Text='<%# Bind("DriveSheaveDiameter") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="data" 
                                                Text='<%# Bind("DriveSheaveDiameter") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("DriveSheaveDiameter") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Driven Sheave Diameter" 
                                        SortExpression="DrivenSheaveDiameter">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" CssClass="data" 
                                                Text='<%# Bind("DrivenSheaveDiameter") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" CssClass="data" 
                                                Text='<%# Bind("DrivenSheaveDiameter") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" 
                                                Text='<%# Bind("DrivenSheaveDiameter") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Belt Size or ID No" SortExpression="BeltLength">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" 
                                                Text='<%# Bind("BeltLength") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" CssClass="data" 
                                                Text='<%# Bind("BeltLength") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("BeltLength") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                                        ShowInsertButton="True" />
                                </Fields>
                                <EmptyDataTemplate>
                                    <asp:Panel ID="Panel1" runat="server" CssClass="emptydata" Height="50px" 
                                        HorizontalAlign="Center" Width="100%">
                                        No Drive Data entered for this location...<br />
                                        <br />
                                        &nbsp;<asp:Button ID="newSealDataButton" runat="server" CssClass="data" 
                                            OnClick="newSealDataButton_Click" Text="Add Drive Data" />
                                    </asp:Panel>
                                </EmptyDataTemplate>
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                            </asp:DetailsView>
                            <asp:SqlDataSource ID="DriveData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [ReducerMfgID], [ReducerModel], [ReducerSerialNo], [ReducerRatio], [DriveSheaveDiameter], [DrivenSheaveDiameter], [BeltLength], [FuncLoc], [ReducerCouplingID], [ReducerWeight], [ReducerCouplingSize] FROM [PumpLocations] WHERE ([FuncLoc] = @FuncLoc)" DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" InsertCommand="INSERT INTO [PumpLocations] ([ReducerMfgID], [ReducerModel], [ReducerSerialNo], [ReducerRatio], [DriveSheaveDiameter], [DrivenSheaveDiameter], [BeltLength], [FuncLoc], [ReducerCouplingID], [ReducerWeight], [ReducerCouplingSize]) VALUES (@ReducerMfgID, @ReducerModel, @ReducerSerialNo, @ReducerRatio, @DriveSheaveDiameter, @DrivenSheaveDiameter, @BeltLength, @FuncLoc, @ReducerCouplingID, @ReducerWeight, @ReducerCouplingSize)" UpdateCommand="UPDATE [PumpLocations] SET [ReducerMfgID] = @ReducerMfgID, [ReducerModel] = @ReducerModel, [ReducerSerialNo] = @ReducerSerialNo, [ReducerRatio] = @ReducerRatio, [DriveSheaveDiameter] = @DriveSheaveDiameter, [DrivenSheaveDiameter] = @DrivenSheaveDiameter, [BeltLength] = @BeltLength, [ReducerCouplingID]  = &#13;&#10;@ReducerCouplingID, [ReducerWeight] = @ReducerWeight, [ReducerCouplingSize] = @ReducerCouplingSize WHERE [FuncLoc] = @FuncLoc">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="ReducerMfgID" Type="Int16" />
                                    <asp:Parameter Name="ReducerModel" Type="String" />
                                    <asp:Parameter Name="ReducerSerialNo" Type="String" />
                                    <asp:Parameter Name="ReducerRatio" Type="String" />
                                    <asp:Parameter Name="DriveSheaveDiameter" Type="String" />
                                    <asp:Parameter Name="DrivenSheaveDiameter" Type="String" />
                                    <asp:Parameter Name="BeltLength" Type="String" />
                                    <asp:Parameter Name="ReducerCouplingID" />
                                    <asp:Parameter Name="ReducerWeight" />
                                    <asp:Parameter Name="ReducerCouplingSize" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="ReducerMfgID" Type="Int16" />
                                    <asp:Parameter Name="ReducerModel" Type="String" />
                                    <asp:Parameter Name="ReducerSerialNo" Type="String" />
                                    <asp:Parameter Name="ReducerRatio" Type="String" />
                                    <asp:Parameter Name="DriveSheaveDiameter" Type="String" />
                                    <asp:Parameter Name="DrivenSheaveDiameter" Type="String" />
                                    <asp:Parameter Name="BeltLength" Type="String" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                    <asp:Parameter Name="ReducerCouplingID" />
                                    <asp:Parameter Name="ReducerWeight" />
                                    <asp:Parameter Name="ReducerCouplingSize" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="ReducerMfgData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [ReducerMfgID], [ReducerMfg] FROM [ReducerMfgs]">
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="ReducerCouplingData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [CouplingTypeID], [CouplingType] FROM [CouplingTypes]">
                            </asp:SqlDataSource>
                        </asp:Panel>
                    </asp:View>
                    
                    <asp:View ID="vwProcess" runat="server"> 
                        <asp:Panel ID="processPanel" runat="server" CssClass="detailpanel">
                            <asp:DetailsView ID="ProcessView" runat="server" AutoGenerateRows="False" BorderColor="Black"
                                BorderStyle="Solid" BorderWidth="1px" DataSourceID="ProcessData"
                                 Width="100%" DataKeyNames="FuncLoc" OnItemUpdating="ProcessView_ItemUpdating" OnDataBound="ProcessView_DataBound"  >
                                <RowStyle BackColor="#EEEB9C" Height="20px" />
                                <Fields>
                                    <asp:TemplateField HeaderText="Lube Type">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DropDownList6" runat="server" CssClass="data" DataSourceID="LubeTypeData"
                                                DataTextField="LubeType" DataValueField="LubeTypeID" SelectedValue='<%# Bind("LubeTypeID") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="DropDownList6" runat="server" CssClass="data" DataSourceID="LubeTypeData"
                                                DataTextField="LubeType" DataValueField="LubeTypeID" SelectedValue='<%# Bind("LubeTypeID") %>'>
                                            </asp:DropDownList>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:DropDownList ID="DropDownList6" runat="server" CssClass="data" DataSourceID="LubeTypeData"
                                                DataTextField="LubeType" DataValueField="LubeTypeID" Enabled="False" SelectedValue='<%# Bind("LubeTypeID") %>'>
                                            </asp:DropDownList>&nbsp;
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Lube Quantity" SortExpression="LubeQuantity">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("LubeQuantity") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("LubeQuantity") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("LubeQuantity") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump GPM" SortExpression="PumpGPM">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PumpGPM") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PumpGPM") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <HeaderStyle Width="150px" />
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("PumpGPM") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump Head Pressure" SortExpression="PumpHeadPressure">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PumpHeadPressure") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PumpHeadPressure") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("PumpHeadPressure") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Pump RPM" SortExpression="PumpRPM">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PumpRPM") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PumpRPM") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("PumpRPM") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Primary Liquid" SortExpression="PumpPrimaryLiquid">
                                        <EditItemTemplate><asp:DropDownList ID="DropDownList10" runat="server" DataSourceID="LiquidTypeData"
                                                DataTextField="LiquidType" DataValueField="LiquidTypeID" CssClass="data" SelectedValue='<%# Bind("LiquidTypeID") %>'>
                                        </asp:DropDownList>&nbsp; 
                                        </EditItemTemplate>
                                        <InsertItemTemplate><asp:DropDownList ID="DropDownList10" runat="server" DataSourceID="LiquidTypeData"
                                                DataTextField="LiquidType" DataValueField="LiquidTypeID" CssClass="data" SelectedValue='<%# Bind("LiquidTypeID") %>'>
                                        </asp:DropDownList>&nbsp; 
                                        </InsertItemTemplate>
                                        <ItemTemplate><asp:DropDownList ID="DropDownList10" runat="server" DataSourceID="LiquidTypeData"
                                                DataTextField="LiquidType" DataValueField="LiquidTypeID" CssClass="data" Enabled="False" SelectedValue='<%# Bind("LiquidTypeID") %>'>
                                        </asp:DropDownList>&nbsp; 
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Operating Temp" SortExpression="PumpOperatingTemp">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("PumpOperatingTemp") %>' CssClass="data"></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("PumpOperatingTemp") %>' CssClass="data"></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("PumpOperatingTemp") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                                </Fields>
                                <HeaderStyle BackColor="#EEEB9C" />
                                <HeaderTemplate>
                                    &nbsp;
                                </HeaderTemplate>
                                <CommandRowStyle CssClass="noshow" />
                            </asp:DetailsView>
                            
                            <asp:SqlDataSource ID="ProcessData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [LubeTypeID], [LubeQuantity], [PumpGPM], [PumpHeadPressure], [PumpRPM], [PumpPrimaryLiquid], [PumpOperatingTemp], [FuncLoc], [LiquidTypeID] FROM [PumpLocations] WHERE ([FuncLoc] = @FuncLoc)" DeleteCommand="DELETE FROM [PumpLocations] WHERE [FuncLoc] = @FuncLoc" InsertCommand="INSERT INTO [PumpLocations] ([LubeTypeID], [LubeQuantity], [PumpGPM], [PumpHeadPressure], [PumpRPM], [PumpPrimaryLiquid], [PumpOperatingTemp], [FuncLoc], [LiquidTypeID]) VALUES (@LubeTypeID, @LubeQuantity, @PumpGPM, @PumpHeadPressure, @PumpRPM, @PumpPrimaryLiquid, @PumpOperatingTemp, @FuncLoc, @LiquidTypeID)" UpdateCommand="UPDATE [PumpLocations] SET [LubeTypeID] = @LubeTypeID, [LubeQuantity] = @LubeQuantity, [PumpGPM] = @PumpGPM, [PumpHeadPressure] = @PumpHeadPressure, [PumpRPM] = @PumpRPM, [PumpPrimaryLiquid] = @PumpPrimaryLiquid, [PumpOperatingTemp] = @PumpOperatingTemp, [LiquidTypeID] = @LiquidTypeID WHERE [FuncLoc] = @FuncLoc">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                        Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="LubeTypeID" Type="Int16" />
                                    <asp:Parameter Name="LubeQuantity" Type="String" />
                                    <asp:Parameter Name="PumpGPM" Type="String" />
                                    <asp:Parameter Name="PumpHeadPressure" Type="String" />
                                    <asp:Parameter Name="PumpRPM" Type="String" />
                                    <asp:Parameter Name="PumpPrimaryLiquid" Type="String" />
                                    <asp:Parameter Name="PumpOperatingTemp" Type="String" />
                                    <asp:Parameter Name="LiquidTypeID" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="LubeTypeID" Type="Int16" />
                                    <asp:Parameter Name="LubeQuantity" Type="String" />
                                    <asp:Parameter Name="PumpGPM" Type="String" />
                                    <asp:Parameter Name="PumpHeadPressure" Type="String" />
                                    <asp:Parameter Name="PumpRPM" Type="String" />
                                    <asp:Parameter Name="PumpPrimaryLiquid" Type="String" />
                                    <asp:Parameter Name="PumpOperatingTemp" Type="String" />
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                    <asp:Parameter Name="LiquidTypeID" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="LubeTypeData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [LubeTypeID], [LubeType] FROM [LubeTypes]">
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="LiquidTypeData" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                                SelectCommand="SELECT [LiquidTypeID], [LiquidType] FROM [LiquidTypes] ORDER BY [LiquidType]">
                            </asp:SqlDataSource>
                        </asp:Panel>                     
                    </asp:View>
                    
                    
        
        
                    <asp:View ID="vwBOM" runat="server">
                        <asp:Panel ID="bomPanel" runat="server" CssClass="detailpanel">
                           <asp:SqlDataSource ID="BOMData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                               SelectCommand="SELECT [BOMID], [FuncLoc], [Qt], [UOM], [Description], [SAPStkNo], [BOMNumber] FROM [PumpBOMView] WHERE ([FuncLoc] = @FuncLoc)" 
                               DeleteCommand="DELETE FROM [BOM] WHERE [BOMID] = @BOMID" 
                               InsertCommand="InsertBOMEntry" InsertCommandType="StoredProcedure" 
                                UpdateCommand="UPDATE [BOM] SET [Qt] = @Qt, [UOM] = @Unit, [SAPStkNo] = @SAPStkNo WHERE [BOMID] = @BOMID" 
                                oninserting="BOMData_Inserting">
                                <SelectParameters>
                                      <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                </SelectParameters>                                
                                <DeleteParameters>
                                    <asp:Parameter Name="BOMID" Type="Int32" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                    <asp:Parameter Name="Qt" Type="Int32" />
                                    <asp:Parameter Name="UOM" Type="String" />
                                    <asp:Parameter Name="SAPStkNo" Type="String" />
                                    <asp:Parameter Name="BOMID" Type="Int32" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                    <asp:Parameter Name="Qt" Type="Int32" />
                                    <asp:Parameter Name="BOMNumber" Type="String" />
                                    <asp:Parameter Name="UOM" Type="String" />
                                    <asp:Parameter Name="SAPStkNo" Type="String" />
                                </InsertParameters>
                                
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="BOMViewData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                               SelectCommand="SELECT [BOMID], [FuncLoc], [Qt], [UOM], [Description], [SAPStkNo], [BOMNumber] FROM [PumpBOMView] WHERE ([FuncLoc] = @FuncLoc)" 
                               DeleteCommand="DELETE FROM [BOM] WHERE [BOMID] = @BOMID" 
                               InsertCommand="InsertBOMEntry" InsertCommandType="StoredProcedure" 
                                UpdateCommand="UPDATE [BOM] SET [Qt] = @Qt, [UOM] = @Unit, [SAPStkNo] = @SAPStkNo WHERE [BOMID] = @BOMID" 
                                oninserting="BOMData_Inserting">
                                <SelectParameters>
                                      <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                </SelectParameters>                                
                                <DeleteParameters>
                                    <asp:Parameter Name="BOMID" Type="Int32" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                    <asp:Parameter Name="Qt" Type="Int32" />
                                    <asp:Parameter Name="UOM" Type="String" />
                                    <asp:Parameter Name="SAPStkNo" Type="String" />
                                    <asp:Parameter Name="BOMID" Type="Int32" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                    <asp:Parameter Name="Qt" Type="Int32" />
                                    <asp:Parameter Name="BOMNumber" Type="String" />
                                    <asp:Parameter Name="UOM" Type="String" />
                                    <asp:Parameter Name="SAPStkNo" Type="String" />
                                </InsertParameters>
                                
                            </asp:SqlDataSource>
                            <asp:GridView ID="BOMView" runat="server" AllowPaging="True" Caption="  "
                                AllowSorting="True" AutoGenerateColumns="False" CssClass="grids" 
                                DataKeyNames="BOMID" DataSourceID="BOMViewData" Width="100%" 
                                EmptyDataText="No BOM found for this Functional Location." 
                                EnableModelValidation="True" PageSize="8" >
                                <RowStyle Height="20px" BackColor="#EEEB9C" />
                                <EmptyDataRowStyle Font-Size="12pt" Height="25px" HorizontalAlign="Center" />
                                <Columns>
                                    <asp:TemplateField>
                                      <ItemTemplate>
                                        <asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit" Text="Edit" 
                                              CssClass="gridcommands" />    
                                        <asp:LinkButton ID="lnkDelete" runat="server" 
                                              OnClientClick="return confirm('Are you sure you want to delete this record?');" 
                                              CommandName="Delete" Text="Delete" CssClass="gridcommands" />
                                                                                                                      
                                      </ItemTemplate>
                                      <EditItemTemplate>
                                        <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" Text="Update" 
                                            CssClass="gridcommands" />
                                        <asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" Text="Cancel" 
                                            CssClass="gridcommands" />                                        
                                      </EditItemTemplate>                                    
                                         <HeaderStyle Width="17%" />                                         
                                         <ItemStyle Width="17%" />   
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="BOMID" HeaderText="BOMID" InsertVisible="False" 
                                        ReadOnly="True" SortExpression="BOMID" >
                                       <ControlStyle CssClass="noshow" />
                                       <HeaderStyle CssClass="noshow" />
                                       <FooterStyle CssClass="noshow" />
                                       <ItemStyle CssClass="noshow" />
                                   </asp:BoundField>                                        
                                    <asp:BoundField DataField="FuncLoc" HeaderText="" 
                                        SortExpression="FuncLoc" >
                                       <ControlStyle CssClass="noshow" />
                                       <HeaderStyle CssClass="noshow" />
                                       <FooterStyle CssClass="noshow" />
                                       <ItemStyle CssClass="noshow" />
                                    </asp:BoundField>
                                    <asp:TemplateField  HeaderText="" 
                                        SortExpression="FuncLoc">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditBOM" runat="server" Text='<%# Bind("BOMNumber") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:Label ID="lblInsertBOM" runat="server" Text='<%# Bind("BOMNumber") %>'></asp:Label>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemBOM" runat="server" Text='<%# Bind("BOMNumber") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ControlStyle CssClass="noshow" />
                                        <HeaderStyle CssClass="noshow" />
                                        <FooterStyle CssClass="noshow" />
                                        <ItemStyle CssClass="noshow" />
                                    </asp:TemplateField>
                                    <asp:TemplateField  HeaderText="Qty" 
                                        SortExpression="Qt">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditQt" runat="server" Width="50px" CssClass="data" Text='<%# Bind("Qt") %>'></asp:TextBox>
                                        </EditItemTemplate>                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemQt" runat="server" CssClass="data" Text='<%# Bind("Qt") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="8%" />  
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Unit" SortExpression="UOM">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlEditUOM" runat="server" CssClass="data"
                                                SelectedValue='<%# Bind("UOM") %>'>                                                
                                                <asp:ListItem>EA</asp:ListItem>
                                                <asp:ListItem>SET</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemUOM" runat="server" Text='<%# Bind("UOM") %>'></asp:Label>
                                        </ItemTemplate>
                                         <HeaderStyle Width="10%" />
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField  HeaderText="Description" 
                                        SortExpression="Description">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditDesc" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:Label ID="lblInsertDesc" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemDesc" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="50%" />
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField  HeaderText="Stock Number" 
                                        SortExpression="SAPStkNo">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditSAPStkNo" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:Label ID="lblInsertSAPStkNo" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:Label>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemSAPStkNo" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="15%" />
                                    </asp:TemplateField>
                                    
                                </Columns>
                                <FooterStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" />
                                <PagerStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" />
                                <HeaderStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" Height="20px" />
                            </asp:GridView>
                                <div id="newBOM" class="uploadpanel">
                                <table cellpadding="1" width="100%" class="uploadtable" >
                                    <tr>
                                    <th class="uploadth">
                                        <asp:Label ID="Label15"  runat="server" Text="Add BOM Entry">
                                        </asp:Label>
                                    </th>
                                    </tr>                                    
                                    <tr ><td align="center">
                            <asp:DetailsView ID="BOMInsertView" runat="server" Width="374px" 
                                DataSourceID="BOMData" AutoGenerateRows="False" DataKeyNames="BOMID" 
                                oniteminserted="BOMInsertView_ItemInserted" 
                                oniteminserting="BOMInsertView_ItemInserting" >
                                <RowStyle Height="20px" BackColor="#EEEB9C" HorizontalAlign="Left"/>
                                <FieldHeaderStyle BackColor="#EEEB9C" ForeColor="Black" HorizontalAlign="Right" />
                                <Fields>                                    
                                    <asp:TemplateField  HeaderText="FuncLoc" 
                                        SortExpression="FuncLoc">
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEditFL" runat="server" Text='<%# Bind("FuncLoc") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:Label ID="lblInsertFL" runat="server" Text='<%# Bind("FuncLoc") %>'></asp:Label>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemFL" runat="server" Text='<%# Bind("FuncLoc") %>'></asp:Label>
                                        </ItemTemplate>
                                    <ControlStyle CssClass="noshow" />
                                       <HeaderStyle CssClass="noshow" />
                                       <FooterStyle CssClass="noshow" />
                                       <ItemStyle CssClass="noshow" />   
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Qt" SortExpression="Qt">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditQt" CssClass="data" runat="server" Text='<%# Bind("Qt") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtInsertQt" CssClass="data" Width="50px" runat="server" Text='<%# Bind("Qt") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemQt" runat="server" Text='<%# Bind("Qt") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Unit" SortExpression="Unit">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlEditUOM" runat="server" CssClass="data"
                                                SelectedValue='<%# Bind("UOM") %>'>                                                
                                                <asp:ListItem>EA</asp:ListItem>
                                                <asp:ListItem>SET</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:DropDownList ID="ddlInsertUOM" runat="server" CssClass="data"
                                                SelectedValue='<%# Bind("UOM") %>'>
                                                <asp:ListItem>EA</asp:ListItem>
                                                <asp:ListItem>SET</asp:ListItem>
                                            </asp:DropDownList>
                                            
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemUOM" runat="server" Text='<%# Bind("UOM") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                               
                                    <asp:TemplateField HeaderText="Stock Number" SortExpression="SAPStkNo">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtEditSAPStkNo" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:TextBox ID="txtInsertSAPStkNo" CssClass="data" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:TextBox>
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemSAPStkNo" runat="server" Text='<%# Bind("SAPStkNo") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowInsertButton="True" InsertText="Insert into BOM" 
                                        ShowCancelButton="false" ControlStyle-CssClass="gridcommands2" />
                                    
                                </Fields>
                                <HeaderStyle BackColor="#EEEB9C" HorizontalAlign="Right" />
                                <RowStyle BackColor="#EEEB9C" />
                            </asp:DetailsView>
                            
                            </td>
                            </tr>
                            </table> 
                            </div>                                
                           
                        </asp:Panel>
                    </asp:View>
                    
                    <asp:View ID="vwDocs" runat="server">
                        <asp:Panel ID="docsPanel" runat="server" CssClass="detailpanel">
                           <asp:SqlDataSource ID="DocsData" runat="server" ConnectionString="<%$ ConnectionStrings:PumpsConnectionString %>"
                               SelectCommand="SELECT [ID], [FuncLoc], [DocDesc], [DocUri] FROM [Documents] WHERE ([FuncLoc] = @FuncLoc)" 
                               DeleteCommand="DELETE FROM [Documents] WHERE [ID] = @ID" 
                               InsertCommand="INSERT INTO [Documents] ([FuncLoc], [DocDesc], [DocUri]) VALUES (@FuncLoc, @DocDesc, @DocUri)" 
                                                              
                                UpdateCommand="UPDATE [Documents] SET [FuncLoc] = @FuncLoc, [DocDesc] = @DocDesc, [DocUri] = @DocUri WHERE [ID] = @ID" 
                                oninserting="DocsData_Inserting">
                                <SelectParameters>
                                      <asp:ControlParameter ControlID="LocationGrid" Name="FuncLoc" PropertyName="SelectedValue"
                                          Type="String" />
                                </SelectParameters>
                                <DeleteParameters>
                                  <asp:Parameter Name="ID" Type="Int32" />
                                </DeleteParameters>
                                <UpdateParameters>
                                  <asp:Parameter Name="FuncLoc" Type="String" />
                                  <asp:Parameter Name="DocDesc" Type="String" />
                                    <asp:Parameter Name="DocUri" Type="String" />
                                    <asp:Parameter Name="ID" Type="Int32" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="FuncLoc" Type="String" />
                                    <asp:Parameter Name="DocDesc" Type="String" />
                                    <asp:Parameter Name="DocUri" Type="String" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:GridView ID="DocsView" runat="server" AllowPaging="True" 
                                AllowSorting="True" AutoGenerateColumns="False" Caption="  " CssClass="grids" Width="100%"
                                DataSourceID="DocsData" onselectedindexchanged="DocsView_SelectedIndexChanged" DataKeyNames="ID" 
                                EmptyDataText="No Documents yet assigned to this Functional Location." >
                                 <RowStyle BackColor="#EEEB9C" Height="20px" />
                                 <PagerStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" />
                                <HeaderStyle BackColor="DarkOliveGreen" ForeColor="#EEEB9C" Height="20px" />
                                <SelectedRowStyle BackColor="YellowGreen"  Height="20px"/> 
                                 <EmptyDataRowStyle Font-Size="12pt" Height="25px" HorizontalAlign="Center" />               
                                <Columns>
                                    <asp:TemplateField>
                                      <ItemTemplate>
                                        <asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit" Text="Edit" 
                                              CssClass="gridcommands" />    
                                        <asp:LinkButton ID="lnkDelete" runat="server" 
                                              OnClientClick="return confirm('Are you sure you want to delete this record?');" 
                                              CommandName="Delete" Text="Delete" CssClass="gridcommands" />
                                        <asp:LinkButton ID="lnkOpen" runat="server" CommandName="Select" Text="Open" 
                                              CssClass="gridcommands" />                                                                               
                                      </ItemTemplate>
                                      <EditItemTemplate>
                                        <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" Text="Update" 
                                            CssClass="gridcommands" />
                                        <asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" Text="Cancel" 
                                            CssClass="gridcommands" />                                        
                                      </EditItemTemplate>                                    
                                         <HeaderStyle Width="155px" Wrap="False"/>                                         
                                         <ItemStyle Width="155px" Wrap="False"/>   
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="ID" HeaderText="ID" 
                                        SortExpression="ID" InsertVisible="False" ReadOnly="True" >
                                        <ControlStyle CssClass="noshow" />
                                         <HeaderStyle CssClass="noshow" />
                                         <FooterStyle CssClass="noshow" />
                                         <ItemStyle CssClass="noshow" />
                                    </asp:BoundField>                                                                       
                                    <asp:BoundField DataField="FuncLoc" HeaderText="FuncLoc" 
                                        SortExpression="FuncLoc" >
                                        <ControlStyle CssClass="noshow" />
                                         <HeaderStyle CssClass="noshow" />
                                         <FooterStyle CssClass="noshow" />
                                         <ItemStyle CssClass="noshow" />
                                    </asp:BoundField>                                              
                                    <asp:BoundField DataField="DocDesc" HeaderText="Document Description" 
                                        SortExpression="DocDesc" >
                                        <ControlStyle Width="300px" />
                                         <HeaderStyle Width="300px" />
                                         <FooterStyle Width="300px" />
                                         <ItemStyle Width="300px" />
                                    </asp:BoundField>                                              
                                    <asp:TemplateField HeaderText="Document File Name" SortExpression="DocUri">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtDocUri" runat="server" Text='<%# Bind("DocUri") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblDocUri" runat="server" Text='<%# Bind("DocUri") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>                               
                                  
                            </asp:GridView>
                            
                            <div id="newdoc" class="uploadpanel" >
                                <table cellpadding="1" class="uploadtable"  >
                                    <tr>
                                    <th class="uploadth">
                                        <asp:Label ID="Label13"  runat="server" Text="Upload New Documents">
                                        </asp:Label>
                                    </th>
                                    </tr>
                                    <tr><td>
                                    <asp:Label ID="Label12" runat="server" Text="Enter Description of Document: "></asp:Label>
                                    <asp:TextBox ID="txtDocDesc" CssClass="data" Width="400px" runat="server"></asp:TextBox>
                                    </td></tr>
                                    <tr><td>
                                    <asp:Label ID="Label11" runat="server" Text="Full path to document: "></asp:Label>
                                        <asp:FileUpload ID="uploadFile" runat="server" width="450px" />
                                        
                                    </td></tr>
                                    <tr><td>
                                    <asp:Button ID="newDocs" runat="server" CssClass="data" Width="100px" Text="Upload"                                
                                        onclick="newDocs_Click" />
                                   </td></tr>
                                 </table>        
                            </div> 
                            
                             </asp:Panel>
                    </asp:View>
                    
                    
                    <asp:View ID="vwPix" runat="server">
                        
                        <asp:Panel ID="pixPanel" runat="server" CssClass="detailpanel">
                            <asp:Image ID="Pix" CssClass="pixlocation" runat="server" />
                         <div id="newPic" class="uploadpanel" >
                                <table cellpadding="1" class="uploadtable">
                                <tr>
                                <th class="uploadth">
                                    <asp:Label ID="Label14"  runat="server" Text="Upload Picture">
                                    </asp:Label>
                                </th>
                                </tr>
                                    <tr><td>
                                    <asp:Label ID="Label16" runat="server" Text="Full path to Picture file: "></asp:Label>
                                    <asp:FileUpload ID="uploadPix" CssClass="data" runat="server" Width="450px"/>
                                    </td></tr>
                                    <tr><td>
                                    <asp:Button ID="newPix" runat="server" CssClass="data" Width="100px" Text="Upload"                                
                                        onclick="newPix_Click" />
                                   </td></tr>
                                 </table>        
                            </div>     
                        </asp:Panel>
                    </asp:View>
                    
                </asp:MultiView>
             
            
            </div> <!-- end of main-->  
            </td></tr>
            <tr><td>
                <div id="bottonrow" class="buttons">
                   
                     <asp:Button ID="editButton" runat="server" Text="Edit" CssClass="data" OnClick="editButton_Click" 
                        Width="75px" />&nbsp;
                     <asp:Button ID="newButton" runat="server" Text="New" CssClass="data" OnClick="newButton_Click" 
                        Width="75px" />&nbsp;
                     <asp:Button ID="deleteButton" runat="server" Text="Delete" CssClass="data" 
                        Width="75px" OnClick="deleteButton_Click" OnClientClick="return confirm('Are you sure you want to delete this record?')" />&nbsp;
                     <asp:Button ID="updateButton" runat="server" CssClass="data" OnClick="updateButton_Click"
                         Text="Update" Width="75px" />&nbsp;
                     <asp:Button ID="cancelButton" runat="server" CssClass="data" OnClick="cancelButton_Click"
                         Text="Cancel" Width="75px" />
                                   
                </div>  
            </td></tr>
           <tr><td> 
            <div class="titlespacer">&nbsp;</div>       
            <div id="copyright">
                 <asp:Label ID="copyrightLabel" runat="server" Text="Label"></asp:Label>      
            </div>            
            <div class="titlespacer">&nbsp;</div>  
            </td></tr>
            </table>
            
        </asp:Panel>
       
       
         
    </asp:Panel>                              
           
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:Randy Wilson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 7

Author Comment

by:Randy Wilson
ID: 24803070
A little follow up... When I break the running code in the ItemUpdating event and do a FindControl on one of the text boxes that I have just entered data into, the value comes back a null string ("").  Using code like:

((TextBox)sender.FindControl("txtPumpModel")).Text

It appears that the values in the text boxes are not even getting back to the server.
0
 
LVL 11

Expert Comment

by:azarc3
ID: 24806100
If I'm not mistaken you're going to want to use ((TextBox)e.FindControl("txtPumpModel")).Text or some variant depending on what Controls are in e.
0
 
LVL 7

Author Comment

by:Randy Wilson
ID: 24807467
azarc3, I might have lead you astray.  The code just let's me know that the textbox values are not coming back to the server.  If you use ((TextBox)e.FindControl("txtPumpModel")) in the ItemUpdating event code you will get a compile time error.   The DetailsViewUpdateEventArgs object cannot be cast to TextBox.  My code listed will reference the given text box from the DetailsView via the sender object when in Edit mode.  That is not the problem.  The DetailsView is failing to update even though the ItemUpdating event is firing and it appears because the NewValues array is no being updated.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 7

Accepted Solution

by:
Randy Wilson earned 0 total points
ID: 24815913
I figured it out...  Dumb call on my part in code, that was put in to fix another problem was overwriting the new form values as soon as the page was posted.  The old carpet syndrome...
0
 
LVL 11

Expert Comment

by:azarc3
ID: 24817058
Good job, wrwilson. Moderator, no obligations from me; please close.
0
 
LVL 7

Author Comment

by:Randy Wilson
ID: 24817121
Thanks, sometimes you just have to look closely.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question