<%@ Page Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" Inherits="PirTickets.TicketFormEdit" Title="Ticket" Codebehind="TicketFormEdit.aspx.cs" EnableViewStateMac="false"%>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
        }
        .style2
        {
        }
        .style3
        {
        }
        .style8
        {
            width: 233px;
        }
        .style10
        {
        }
        .style12
        {
        }
        .style13
        {
            width: 239px;
        }
        .style14
        {
            width: 416px;
        }
        .style15
        {
            width: 80px;
        }
        .style16
        {
            width: 469px;
        }
        .style17
        {
            width: 424px;
        }
        .style19
        {
        }
        .style21
        {
            width: 123px;
        }
        .style22
        {
            width: 91px;
        }
        .style23
        {
            width: 129px;
        }
        .style24
        {
            width: 427px;
        }
        .style25
        {
            width: 594px;
        }
        .style26
        {
            width: 416px;
            font-weight: bold;
        }
        .style27
        {
            width: 107px;
        }
        .style28
        {
            height: 168px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <h2>Repair Details</h2>
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
    </asp:UpdatePanel>
   
    <table cellpadding="2" border="0" style="width: 676px">
        <tr>
            <td class="style17">Repair ID:</td>
            
            <td class="style10">
                <asp:Label ID="lblRepairID" runat="server" Text="Label" Font-Bold="True" 
                    Font-Size="Medium"></asp:Label>
            </td>
            <td colspan="2">  
            <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                <ContentTemplate>         
                 <asp:Label ID="lblStatusAlert" runat="server" Font-Bold="True" 
                    Font-Size="Medium" ForeColor="Blue"></asp:Label>
           </ContentTemplate>
           </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td valign="top" class="style17">Date Received:</td>
            
            <td valign="top" class="style10">
                <asp:Label ID="lblDateReceived" runat="server" Text="Label"></asp:Label>
            </td>
            <td valign="top" class="style1">           
                <asp:Label ID="lblPriority" runat="server" Text="Priority:"></asp:Label>
                </td>
            <td  valign="top">
               <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                <asp:DropDownList ID="DDPriority" runat="server" DataSourceID="SqlDataPriority" 
                    DataTextField="priority_name" DataValueField="level" AutoPostBack="True" 
                     onselectedindexchanged="DDPriority_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataPriority" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                    SelectCommand="SELECT [level], [priority_name] FROM [priority]">
                </asp:SqlDataSource>
               </ContentTemplate>        
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td  valign="top">Customer ID:</td>
            
            <td  valign="top"><asp:Label  ID="lblCustomerID" runat="server" Height="27px" 
                    Width="158px" Font-Bold="True" /></td>
                    <td valign="top">           
                        Status:</td>
            <td  valign="top">
              <asp:SqlDataSource ID="SqlDataStatus" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                    SelectCommand="SELECT [id], [status_name] FROM [statuses]">
                </asp:SqlDataSource>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddStatus" runat="server" 
                            DataSourceID="SqlDataStatus" DataTextField="status_name" 
                            DataValueField="id" onselectedindexchanged="ddStatus_SelectedIndexChanged" 
                            AutoPostBack="True">
                        </asp:DropDownList>
                    </ContentTemplate>
                
                </asp:UpdatePanel>
                
            </td>
        </tr>
        <tr>
            <td  valign="top"></td>
            
            <td  valign="top"></td>
                    <td valign="top">           
                        Repair Complete:</td>
            <td  valign="top">
            <asp:UpdatePanel ID="UpdatePanel24" runat="server">
                    <ContentTemplate>
                <asp:CheckBox ID="cbComplete" runat="server" AutoPostBack="True" 
                    oncheckedchanged="cbComplete_CheckedChanged" />
                        <asp:Label ID="lblAlert2" runat="server" Font-Bold="True" ForeColor="Red" 
                            Visible="False"></asp:Label>
                   </ContentTemplate>
                   </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td  valign="top"></td>
            
            <td  valign="top"></td>
                    <td valign="top">           
                        Date Completed:</td>
            <td  valign="top">
            <asp:UpdatePanel ID="UpdatePanel25" runat="server">
                    <ContentTemplate>
                <telerik:RadDatePicker ID="DPCompleted" Runat="server" ShowPopupOnFocus="True">
                </telerik:RadDatePicker>
                </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="style17" valign="top">Cust Tel:</td>
            
            <td class="style10" valign="top">
                <strong><asp:Label ID="lblTel" runat="server"></asp:Label></strong>
            </td>
                    <td valign="top" colspan="2">           
                        <asp:Label ID="lblAlert" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
            </td>
        </tr>
         <tr>
            <td class="style17">Received By:</td>
            
            <td class="style10">
                <asp:Label ID="lblReceivedby" runat="server" Text="Label" Font-Bold="True"></asp:Label>
             </td>
            <td class="style1">Assigned Technician:</td>
            <td class="style1">
                <asp:UpdatePanel ID="UpdatePanel23" runat="server">
                    <ContentTemplate>
                <asp:DropDownList ID="DDAssignedTechnician"  runat="server" Width="142px" />
                 </ContentTemplate>
                
                </asp:UpdatePanel>
                </td>
        </tr>
         <tr>
            <td class="style17" valign="top">Location:</td>
            
            <td class="style10">
                <asp:DropDownList ID="ddSites" runat="server" DataSourceID="SqlDataSites" 
                    DataTextField="sitename" DataValueField="id">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSites" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                    SelectCommand="SELECT [id], [sitename] FROM [sites]"></asp:SqlDataSource></td>
            <td class="style1">
                <asp:Label ID="lblAssignPeer" runat="server" Text="Assign Peer Check:"></asp:Label>
             </td>
            <td class="style1">
                <asp:DropDownList ID="ddassignpeer" runat="server"  Width="142px">
                </asp:DropDownList>
             </td>
        </tr>
         <tr>
            <td class="style17" valign="top">External Ref: </td>
            
            <td class="style10" colspan="2">
                <asp:TextBox ID="txtRef" runat="server" MaxLength="150" Width="300px"></asp:TextBox>
             </td>
            <td class="style1">
                &nbsp;</td>
        </tr>
         </table>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" 
        MultiPageID="RadMultiPage1" SelectedIndex="0" 
        >
        <Tabs>
            <telerik:RadTab runat="server" PageViewID="RadPageView1"             
                Text="Equipment Details" Selected="True">
            </telerik:RadTab>
            <telerik:RadTab runat="server" PageViewID="RadPageView2" Text="Repair Details">
            </telerik:RadTab>
            <telerik:RadTab runat="server" PageViewID="RadPageView3" Text="Parts Replaced" 
                 ></telerik:RadTab>
            <telerik:RadTab runat="server" PageViewID="RadPageView4" Text="Misc. Parts" >
            </telerik:RadTab>
            <telerik:RadTab runat="server" PageViewID="RadPageView5" Text="Repair History" 
                Visible="False">
            </telerik:RadTab>
            <telerik:RadTab runat="server" PageViewID="RadPageView6" Text="Costs">
            </telerik:RadTab>
        </Tabs>
    
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="RadPageView1" runat="server">
        
        <table cellpadding="2" border="0">
                <tr>
                    <td class="style2" colspan="2">&nbsp;</td>
                    <td class="style16">&nbsp;</td></tr>
                <tr>
                    <td class="style25" valign="top">Manufacturer Name:<br /></td>
                    <td class="style15"><asp:UpdatePanel ID="UpdatePanel4" runat="server">
                        <ContentTemplate>
                                <asp:DropDownList ID="DDManufacturer" runat="server" AutoPostBack="True" 
                                DataTextField="manufacturer" DataValueField="id" 
                                onselectedindexchanged="DDManufacturer_SelectedIndexChanged"></asp:DropDownList>
                                <asp:Label ID="lblManufacturer" runat="server" ForeColor="#FF3300" 
                                Text="Enter Manufacturer"></asp:Label></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style16" valign="top">&nbsp;</td>
                    <td class="style1" rowspan="2" valign="top">&nbsp;</td></tr>
                <tr>
                    <td class="style25" valign="top">
                        <asp:Label ID="lblOtherMan" runat="server" Text="Other Manufacturer:"></asp:Label></td>
                    <td class="style15"><asp:TextBox ID="txtOtherMan" runat="server" Width="213px"></asp:TextBox></td>
                    <td class="style16" valign="top">
                        <asp:Button ID="btOtherMan" runat="server" onclick="btOtherMan_Click" 
                            Text="Add Man." ToolTip="Add this manufacturer to the main list" /></td></tr>
                <tr>
                    <td class="style25" valign="top">Model:</td>
                    <td colspan="3">
                        <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DDLModel" runat="server" DataTextField="ModelName" 
                                    DataValueField="modelid"></asp:DropDownList></ContentTemplate></asp:UpdatePanel></td></tr>
                <tr>
                    <td class="style25" valign="top">
                        <asp:Label ID="lblOtherModel" runat="server" Text="Other Model:"></asp:Label></td>
                    <td colspan="3">
                        <asp:TextBox ID="txtOtherModel" runat="server" Width="310px" />
                        <asp:Button ID="btModel" runat="server" onclick="btModel_Click" 
                            Text="Add Model" ToolTip="Add this Model to the main list" /></td></tr>
                <tr>
                    <td class="style25" valign="top">Serial Number:</td>
                    <td colspan="3">
                        <asp:TextBox ID="txtSerial" runat="server" Width="246px" MaxLength="50" 
                            ontextchanged="txtSerial_TextChanged" />
                        <asp:HyperLink ID="hlPrevious" 
                            runat="server" Target="_blank" Visible="False">Previous Repair History</asp:HyperLink></td></tr>
                <tr>
                    <td class="style25" valign="top">Equipment Description:</td>
                    <td colspan="3">
                        <asp:TextBox ID="TxtEquipmentDescription" runat="server" Columns="60" 
                            Height="59px" Rows="10" TextMode="MultiLine" Width="493px" /></td></tr>
                <tr>
                    <td class="style25" valign="top">Problem Description:</td>
                    <td colspan="3">
                        <asp:TextBox ID="TxtProblemDescription" runat="server" Height="99px" 
                            TextMode="MultiLine" Width="493px" /></td></tr>
                <tr><td class="style25">Invoice ID:</td>
                    <td class="style15">
                        <asp:TextBox ID="TxtInvoiceID" runat="server" Enabled="False" MaxLength="10" /></td>
                    <td class="style16">
                        <asp:Label ID="lblBag" runat="server" Text="With Laptop Bag:"></asp:Label></td>
                    <td>
                        <asp:CheckBox ID="CbxWithBezel" runat="server" /></td></tr>
                <tr><td class="style25">&nbsp;</td>
                    <td class="style15">&nbsp;</td><td class="style16">
                        <asp:Label ID="lblCharger" runat="server" Text="With Charger:"></asp:Label></td>
                    <td>
                        <asp:CheckBox ID="CbxWithPowerCord" runat="server" /></td></tr>
                <tr>
                    <td class="style25" valign="top">Prev Service Date:</td>
                    <td class="style15" valign="top">
                        <telerik:RadDatePicker ID="DPPrevServiceDate" Runat="server" Culture="en-GB"></telerik:RadDatePicker></td>
                    <td class="style16" valign="top">
                        <asp:Label ID="lblBatt" runat="server" Text="With Battery:"></asp:Label></td>
                    <td>
                        <asp:CheckBox ID="CbxWithSignalCable" runat="server" /></td></tr>
                <tr>
                    <td class="style25">Estimated Completion:</td>
                    <td class="style15">
                        <telerik:RadDatePicker ID="DPDatePromised" Runat="server"></telerik:RadDatePicker></td>
                    <td class="style16">Warranty Work:</td>
                    <td>
                        <asp:CheckBox ID="CbxWarrantyWork" runat="server" /></td></tr>
                <tr><td class="style25">Estimated Cost:</td>
                    <td class="style15"><asp:UpdatePanel ID="UpdatePanel10" runat="server">
                        <ContentTemplate><asp:TextBox ID="TxtEstimatedCost" runat="server" MaxLength="19" 
                                Width="60px">0.00</asp:TextBox></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style16">Warranty Expires:</td>
                    <td>
                        <telerik:RadDatePicker ID="DPCompleted1" Runat="server" 
                            PopupDirection="BottomLeft"></telerik:RadDatePicker></td></tr>
                <tr>
                    <td class="style25">Diagnostic Fee:</td>
                    <td class="style15">
                        <asp:UpdatePanel ID="UpdatePanel11" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="TxtBenchFee" runat="server" MaxLength="19" Width="60px">0.00</asp:TextBox>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                    ControlToValidate="TxtBenchFee" ErrorMessage="Not Valid" MaximumValue="1000000" 
                                    MinimumValue="0" SetFocusOnError="True" Type="Double"></asp:RangeValidator></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style16"><asp:UpdatePanel ID="UpdatePanel17" runat="server">
                        <ContentTemplate>
                                <asp:Label ID="lblCourier" runat="server" Text="Courier Name:"></asp:Label></ContentTemplate></asp:UpdatePanel></td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel18" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCourier" runat="server" MaxLength="50"></asp:TextBox></ContentTemplate></asp:UpdatePanel></td></tr>
                <tr>
                    <td class="style25">Deposit Paid:</td>
                    <td class="style15">
                        <asp:UpdatePanel ID="UpdatePanel12" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DDDepositDue" runat="server" /></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style16"><asp:UpdatePanel ID="UpdatePanel19" runat="server">
                        <ContentTemplate>
                                <asp:Label ID="lblShipping" runat="server" Text="Shipping Time:"></asp:Label></ContentTemplate></asp:UpdatePanel></td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel20" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtShipping" runat="server" MaxLength="20"></asp:TextBox></ContentTemplate></asp:UpdatePanel></td></tr>
                <tr>
                    <td class="style25">Ship Via:</td><td class="style15">
                        <asp:UpdatePanel ID="UpdatePanel16" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DDShipVia" runat="server" AutoPostBack="True" 
                                    MaxLength="50" onselectedindexchanged="DDShipVia_SelectedIndexChanged" /></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style16"><asp:UpdatePanel ID="UpdatePanel21" runat="server">
                        <ContentTemplate>
                                <asp:Label ID="lblTracking" runat="server" Text="Tracking No.:"></asp:Label></ContentTemplate></asp:UpdatePanel></td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel22" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtTracking" runat="server"></asp:TextBox></ContentTemplate></asp:UpdatePanel></td></tr></table></telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server" Width="100%"><table  cellpadding="2" border="0">
                <tr>
                    <td class="style24">&nbsp;</td><td class="style8">&nbsp;</td><td class="style14">&nbsp;</td><td>&nbsp;</td></tr>
                <tr>
                    <td class="style24"><strong>Work Completed:</strong></td>
                    <td class="style8">
                        <asp:UpdatePanel ID="UpdatePanel14" runat="server">
                            <ContentTemplate>
                                <asp:CheckBox ID="cbtechsignoff" runat="server" /></ContentTemplate></asp:UpdatePanel></td>
                    <td class="style26">
                        <asp:Label ID="lblPeerChecked" runat="server" Text="Peer Checked:"></asp:Label></td><td class="style1">
                        <asp:CheckBox ID="cbtechsignoff2" runat="server" 
                        oncheckedchanged="cbtechsignoff2_CheckedChanged" /></td></tr>
                <tr>
                    <td class="style24">No Problem Found:</td>
                    <td class="style8">
                        <asp:CheckBox ID="cbNoProblemFound" runat="server" 
                            oncheckedchanged="cbNoProblemFound_CheckedChanged" /></td>
                    <td class="style14">&nbsp;</td><td class="style1">&nbsp;</td></tr><tr>
                    <td class="style24">Uneconomical:</td><td class="style8">
                        <asp:CheckBox ID="cbUneconomical" runat="server" 
                oncheckedchanged="cbUneconomical_CheckedChanged" /></td>
                    <td class="style14">No Parts Available:</td>
                    <td class="style1">
                        <asp:CheckBox ID="cbNoPartsAvailable" runat="server" 
                            oncheckedchanged="cbNoPartsAvailable_CheckedChanged" /></td></tr>
                <tr>
                    <td class="style24">Date Completed:</td>
                    <td class="style8">
                        <asp:UpdatePanel ID="UpdatePanel15" runat="server"></asp:UpdatePanel></td>
                    <td class="style14">Time to Repair:</td>
                    <td class="style1">
                        <asp:DropDownList ID="ddlHours" runat="server"></asp:DropDownList>
                        <asp:DropDownList ID="ddlMinutes" runat="server"></asp:DropDownList></td></tr>
                <tr>
                    <td class="style24" valign="top">Repair Steps:</td>
                    <td class="style3" colspan="3" rowspan="3" valign="top">
                        <asp:TextBox ID="txtRepair" runat="server" Height="108px" 
                            style="margin-top: 0px" TextMode="MultiLine" Width="492px"></asp:TextBox></td></tr>
                <tr>
                    <td class="style24" valign="top">&nbsp;</td></tr>
                <tr>
                    <td class="style24" valign="top">&nbsp;</td></tr>
                <tr><td class="style24" valign="top">Comments:</td>
                    <td class="style3" colspan="3" rowspan="4" valign="top">
                        <asp:TextBox ID="txtComments" runat="server" Height="82px" TextMode="MultiLine" 
                            Width="492px"></asp:TextBox></td></tr>
                <tr><td class="style24" valign="top">&nbsp;</td></tr>
                <tr>
                    <td class="style24" valign="top">&nbsp;</td></tr>
                <tr><td class="style24" valign="top">&nbsp;</td></tr>
                <tr>
                    <td class="style24">&nbsp;</td><td class="style8">&nbsp;</td><td class="style14">&nbsp;</td><td>&nbsp;</td></tr></table></telerik:RadPageView>
           <telerik:RadPageView  ID="RadPageView3" runat="server" Width="100%">
           <asp:UpdatePanel
        runat="server" ID="partspanel" >
        <ContentTemplate>
           <table border="0" cellpadding="2">
                   <tr>
                       <td class="style12" colspan="2">
                                   Listed Parts Replaced:<br />
                   <input id="Button2" onclick="openRadWin();" type="button" value="Add Part" />
                </td></tr>
               <tr>
                   <td class="style12" colspan="2">
                       <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                           AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                           DataKeyNames="id" DataSourceID="SqlDataSource1" 
                           EmptyDataText="No Listed Parts included in this Repair" ForeColor="#333333" 
                           onrowcommand="GridView2_RowCommand" onrowdeleted="GridView2_RowDeleted" 
                           onrowdeleting="GridView2_RowDeleting" 
                           onselectedindexchanged="GridView2_SelectedIndexChanged" 
                           onselectedindexchanging="GridView2_SelectedIndexChanging" ShowFooter="True" 
                           Width="519px">
                           <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                           <Columns>
                               <asp:CommandField ShowDeleteButton="True" />
                               <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                   ReadOnly="True" SortExpression="id" />
                               <asp:BoundField DataField="partno" HeaderText="Part No." 
                                   SortExpression="partno" />
                               <asp:BoundField DataField="partname" HeaderText="partname" 
                                   SortExpression="partname" />
                               <asp:BoundField DataField="quantity" HeaderText="quantity" 
                                   SortExpression="quantity" />
                               <asp:BoundField DataField="total" HeaderText="Cost" SortExpression="total" />
                           </Columns>
                           <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                           <PagerStyle BackColor="#284775" ForeColor="White" 
                           HorizontalAlign="Center" />
                           <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" 
                           ForeColor="#333333" />
                           <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                           <EditRowStyle BackColor="#999999" />
                           <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                       </asp:GridView>
                   </td>
               </tr>
               <tr>
                   <td class="style12" colspan="2">
                       &nbsp;</td>
               </tr>

               <tr>
                   <td class="style27">
                       Listed Parts Cost:</td>
                   <td class="style13">
                       <asp:Label ID="lblmiscCost" runat="server" Text="0.00"></asp:Label>
                   </td>
               </tr>
               <tr>
                   <td class="style27">
                                 

                    &nbsp;</td><td class="style13">&nbsp;</td></tr>
                   <tr>
                       <td class="style19" colspan="2">
               <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                               ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                               DeleteCommand="DELETE from partsused where id= @id" 
                               SelectCommand="SELECT partsused.id, partsstore.partno, partsstore.partname, partsused.quantity,partsused.quantity * cost as total  FROM partsstore INNER JOIN partsused ON partsstore.id = partsused.partID WHERE ([repairID] = @repairID)">
                   <SelectParameters>
                       <asp:QueryStringParameter Name="repairID" QueryStringField="repID" 
                           Type="Int32" />
                   </SelectParameters>
               </asp:SqlDataSource>
               </td></tr></table>
               <table border="0" cellpadding="2"><tr>
                   <td>
                     <script type="text/javascript">
                         //<![CDATA[
                         function openRadWin() {
                             radopen("PartAdd.aspx", "Add Part to Repair");
                         }
                         /* Called when a window is being closed. */
                         function OnClientClose(radWindow) {
                             //Another option for passing a callback value
                             //Set the radWindow.Argument property in the dialog
                             __doPostBack('ctl00$ContentPlaceHolder1', '');

                             //Do cleanup if necessary  
                         }

                         //]]>                                                                        
                 </script> </td></tr>
                   </table>
</ContentTemplate>
        </asp:UpdatePanel>                   
               </telerik:RadPageView>
               <telerik:RadPageView ID="RadPageView4" runat="server">
<table>
               <tr>
                   <td class="style12" 
                    colspan="2">
                       Miscellaneous Parts Replaced:&nbsp;
                   </td>
               </tr>
               <tr>
                   <td class="style28" colspan="2">
                   <asp:TextBox ID="txtPartsOrdered" runat="server" Columns="60" Height="127px" 
                           TextMode="MultiLine" Width="521px"></asp:TextBox></td></tr>
               <tr>
                   <td class="style27">Parts Ordered:</td>
                   <td class="style13">
                       <telerik:RadDatePicker ID="DPPartsOrdered" Runat="server" 
                           PopupDirection="BottomLeft"></telerik:RadDatePicker></td></tr>
                   <tr>
                   <td class="style27">Parts Received:</td><td class="style13"><telerik:RadDatePicker 
                           ID="DPPartsReceived" Runat="server" PopupDirection="BottomLeft"></telerik:RadDatePicker></td></tr>
                   <tr>
                   <td class="style27">Misc. Parts Cost:</td>
                       <td class="style13">
                           <asp:UpdatePanel ID="UpdatePanel13" runat="server">
                               <ContentTemplate>
                                   <asp:TextBox ID="txtPartsCost" runat="server" AutoPostBack="True" MaxLength="7" 
                                       ontextchanged="txtPartsCost_TextChanged" Width="60px">0.00</asp:TextBox>
                                   <asp:RangeValidator ID="RangeValidator2" runat="server" 
                                       ControlToValidate="txtPartsCost" ErrorMessage="Not Valid" 
                                       MaximumValue="1000000" MinimumValue="0" SetFocusOnError="True" Type="Double"></asp:RangeValidator></ContentTemplate></asp:UpdatePanel></td></tr>

</table>               
               
               
               </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView5" runat="server"><br /><asp:Label ID="lblModel" runat="server" Text="Label"></asp:Label>
            <asp:GridView ID="gvPrev" runat="server" AutoGenerateSelectButton="True" 
                DataKeyNames="OrderID" onselectedindexchanged="gvPrev_SelectedIndexChanged" 
                Width="583px"></asp:GridView></telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView6" runat="server" Width="100%"><table><tr>
                <td class="style21" valign="top">Delivery Date:</td>
                <td class="style22" valign="top">
                    <telerik:RadDatePicker ID="DPDelivered" Runat="server"></telerik:RadDatePicker></td>
                <td class="style23">Labour Cost:</td><td valign="top"><asp:UpdatePanel ID="UPLabour" runat="server" ><ContentTemplate>
                        <asp:TextBox ID="txtLabour" runat="server" MaxLength="7" 
                ontextchanged="txtLabour_TextChanged" Width="60px" AutoPostBack="True">0.00</asp:TextBox>
                        <asp:RangeValidator ID="RangeValidator3" runat="server" 
                    ControlToValidate="txtLabour" ErrorMessage="Not Valid" MaximumValue="1000000" 
                    MinimumValue="0" SetFocusOnError="True" Type="Double"></asp:RangeValidator></ContentTemplate></asp:UpdatePanel></td>
                <td valign="top">
                    &nbsp;</td>
            </tr>
                <tr>
                    <td class="style21" valign="top">Paid in Full:</td>
                    <td class="style22" valign="top">
                        <asp:CheckBox ID="cbPaid" runat="server" AutoPostBack="True" 
                            oncheckedchanged="cbPaid_CheckedChanged" /></td>
                    <td class="style23">
                        <asp:Label ID="lblSalestax" runat="server" Text="VAT Cost:"></asp:Label></td>
                    <td valign="top"><asp:UpdatePanel ID="UpdatePanel7" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="txtVAT" runat="server" AutoPostBack="True" 
                                MaxLength="7" Width="60px">0.00</asp:TextBox></ContentTemplate></asp:UpdatePanel></td>
                    <td valign="top">
                        &nbsp;</td>
            </tr>
                <tr>
                    <td class="style21" valign="top">Date Paid:</td>
                    <td class="style22" valign="top">
                        <telerik:RadDatePicker ID="DPPaid" Runat="server"></telerik:RadDatePicker></td>
                    <td class="style23">Amount Paid:</td><td valign="top">
                        <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtAmountPaid" runat="server" AutoPostBack="True" 
                                    MaxLength="7" ontextchanged="txtAmountPaid_TextChanged" Width="60px">0.00</asp:TextBox>
                                <asp:RangeValidator ID="RangeValidator4" runat="server" 
                                    ControlToValidate="txtAmountPaid" ErrorMessage="Not Valid" 
                                    MaximumValue="1000000" MinimumValue="0" SetFocusOnError="True" Type="Double"></asp:RangeValidator></ContentTemplate></asp:UpdatePanel></td>
                    <td valign="top">
                        &nbsp;</td>
            </tr>
                <tr>
                    <td class="style21">&nbsp;</td><td class="style22">&nbsp;</td><td class="style23">Amount Due:</td><td>
                        <asp:UpdatePanel ID="UpdatePanel9" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtAmountDue" runat="server" AutoPostBack="True" MaxLength="7" 
                                    ontextchanged="txtAmountDue_TextChanged" Width="60px">0.00</asp:TextBox>
                                <asp:CheckBox ID="cbCalc" runat="server" Checked="True" Text="Auto" /></ContentTemplate></asp:UpdatePanel></td>
                    <td>
                        <asp:Button ID="bRefresh" runat="server" onclick="bRefresh_Click" 
                            Text="Refresh" />
                    </td>
            </tr></table></telerik:RadPageView>
    </telerik:RadMultiPage>
  
        <table>
       <tr>
            <td>

                <asp:Button ID="BtnUpdate"  runat="server" Text="Save" 
                    onclick="BtnUpdate_Click" Width="94px" />&nbsp;<asp:Button 
                    ID="btBookout" runat="server" onclick="btBookout_Click" 
                    Text="Print Bookout Form" Width="130px" />
&nbsp;<asp:Button ID="btLabels" runat="server" onclick="btLabels_Click" Text="Reprint Labels" />

                <asp:Button ID="BtnCancel" CausesValidation="false" runat="server" Text="Cancel" onclick="BtnCancel_Click" />

                <asp:Button ID="bDelete" runat="server" onclick="bDelete_Click" Text="Delete" />

                </td>
        </tr>
    </table>
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
                    Behavior="Default" InitialBehavior="None" Left="350" Top="200" Height="400" Width="800" 
                    OnClientClose="OnClientClose">
                    <Windows>
                    <telerik:RadWindow ID="RadWindow1" runat="server" Behavior="Default" 
                    InitialBehavior="None" Left="" Top="">
                </telerik:RadWindow>                    
                </Windows>
                </telerik:RadWindowManager>
</asp:Content>
