<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true" CodeBehind="CustomerEdit.aspx.cs" Inherits="PirTickets.CustomerEdit" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <style type="text/css">
        .style3
        {
            width: 138px;
        }
        .style4
        {
            width: 191px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
    <table cellpadding="2" border="0">
 <tr><td colspan="4"><h3>Edit Customer Details</h3></td></tr>
        <tr>
            <td class="style3">ID</td>
            <td>&nbsp;</td>
            <td class="style4">
                <asp:Label ID="lblCustId" runat="server" Text="Label"></asp:Label>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">Username:</td>
            <td>&nbsp;</td>
            <td class="style4">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="txtUsername" runat="server" MaxLength="50" 
                    ontextchanged="txtUsername_TextChanged" Width="209px" AutoPostBack="True"></asp:TextBox>
                <asp:Label ID="lblExists" runat="server"></asp:Label>
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
                    AssociatedUpdatePanelID="UpdatePanel1">
                </asp:UpdateProgress>
                </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">Organization Name:</td>
            <td></td>
            <td class="style4">
                <asp:TextBox ID="TxtOrganizationName" MaxLength="50" 
                    runat="server" Width="282px" /></td>
            <td>Trade? :<asp:CheckBox ID="cbTrade" runat="server" />
            </td>
        </tr>
        </table>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server"  MultiPageID="RadMultiPage1" SelectedIndex="0">
    <Tabs>
    <telerik:RadTab runat="server" PageViewID="RadPageView1" 
                Text="Details" />
    <telerik:RadTab runat="server" PageViewID="RadPageView2" 
                Text="More Detail" />
 <telerik:RadTab runat="server" PageViewID="RadPageView3" 
                Text="Repairs" />                
    </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server"  SelectedIndex="0" >
        <telerik:RadPageView ID="RadPageView1" runat="server">
            
        <table>
        <tr>
            <td class="style3">New Password:</td>
            <td>&nbsp;</td>
            <td class="style4">
                
                <asp:TextBox ID="txtPassword" runat="server" MaxLength="50" 
                        ontextchanged="txtPassword_TextChanged"></asp:TextBox>
             
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">&nbsp;</td>
            <td>&nbsp;</td>
            <td class="style4">
            
                &nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">Contact Title:</td>
            <td>&nbsp;</td>
            <td class="style4"><asp:TextBox ID="TxtContactTitle" MaxLength="50" runat="server" 
                    Width="74px" /></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">First Name:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtFirstName" MaxLength="50" runat="server" /></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TxtFirstName" ErrorMessage="First Name Required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style3">Last Name:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtLastName" MaxLength="50" runat="server" 
                    Width="171px" /></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="TxtLastName" ErrorMessage="Surname Required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style3">Address:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtAddress" MaxLength="255" runat="server" 
                    Width="239px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Region:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtRegion" MaxLength="50" runat="server" 
                    Width="165px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">City:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtCity" MaxLength="50" runat="server" 
                    Width="155px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">County:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtState" MaxLength="50" runat="server" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Postal Code:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtPostalCode" MaxLength="20" runat="server" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Country:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtCountry" MaxLength="50" runat="server" >UK</asp:TextBox>
            </td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Email:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtEmailName" MaxLength="50" runat="server" 
                    Width="307px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Phone Number:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtPhoneNumber" MaxLength="30" runat="server" 
                    Width="171px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Mobile Phone:</td>
            <td>&nbsp;</td>
            <td class="style4"><asp:TextBox ID="TxtMobilePhone" MaxLength="30" runat="server" 
                    Width="171px" /></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style3">Fax Number:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtFaxNumber" MaxLength="30" runat="server" 
                    Width="168px" /></td>
            <td></td>
        </tr>
        </table>
        </telerik:RadPageView>
    
        <telerik:RadPageView ID="RadPageView2" runat="server">
        <table>
        <tr>
            <td valign="top" class="style3">Note:</td>
            <td></td>
            <td class="style4"><asp:TextBox ID="TxtNote" MaxLength="1073741823" 
                    TextMode="MultiLine" Rows="5" runat="server" Width="293px" /></td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Payment Terms:</td>
            <td></td>
            <td class="style4">
                <asp:DropDownList ID="DDPayment" runat="server" DataSourceID="SqlDataPayments" 
                    DataTextField="PaymentTerms" DataValueField="ID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataPayments" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                    SelectCommand="SELECT [ID], [PaymentTerms], [NumberOfDays] FROM [PaymentTerms]">
                </asp:SqlDataSource>
            </td>
            <td></td>
        </tr>
        <tr>
            <td class="style3">Preferred<br />
                Delivery Route:</td>
            <td></td>
            <td class="style4">
                <asp:DropDownList ID="ddShipping" runat="server" 
                    DataSourceID="SqlDataShipping" DataTextField="ShipMethod" 
                    DataValueField="ID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataShipping" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
                    SelectCommand="SELECT [ID], [ShipMethod] FROM [shipvia]">
                </asp:SqlDataSource>
            </td>
            <td></td>
        </tr>
            <tr>
                <td class="style3">Date Added:</td>
                <td></td>
                <td class="style4">
                    <asp:Label ID="lblAdded" runat="server" Text="Label"></asp:Label>
                </td>
                <td></td>
            </tr>
            </table>
     </telerik:RadPageView>
    
        <telerik:RadPageView ID="RadPageView3" runat="server">  
        
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AutoGenerateSelectButton="True" DataKeyNames="OrderID" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
    Width="600px" AllowSorting="True" 
        AutoGenerateColumns="False" DataSourceID="SqlDataCustTickets" 
        EmptyDataText="No repairs to view" CellPadding="4" 
    ForeColor="#333333" ShowFooter="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="OrderID" HeaderText="OrderID" ReadOnly="True" 
                SortExpression="OrderID" />
            <asp:BoundField DataField="manufacturer" HeaderText="Make" 
                SortExpression="manufacturer" />
            <asp:BoundField DataField="ModelName" HeaderText="Model" 
                SortExpression="ModelName" />
            <asp:BoundField DataField="SerialNumber" HeaderText="Serial" 
                SortExpression="SerialNumber" />
            <asp:BoundField DataField="Received" HeaderText="Received" ReadOnly="True" 
                SortExpression="Received" />
            <asp:CheckBoxField DataField="RepairCompleted" HeaderText="Completed" 
                SortExpression="RepairCompleted" />
            <asp:BoundField DataField="priority_name" HeaderText="Priority" 
                SortExpression="priority_name" />
            <asp:BoundField DataField="status_name" HeaderText="Status" 
                SortExpression="status_name" />
        </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>
    <asp:SqlDataSource ID="SqlDataCustTickets" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PirTickets %>" 
        SelectCommand="SELECT [OrderID], [manufacturer], [ModelName], [SerialNumber], [Received], [RepairCompleted], [priority_name], [status_name] FROM [vwCustomerTickets] WHERE ([CustomerID] = @CustomerID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CustomerID" QueryStringField="custid" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>  
    </telerik:RadPageView>
    </telerik:RadMultiPage>
            
            <table>
        <tr>
            <td colspan="2"></td>
            <td colspan="2">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:Button ID="BtnUpdate" runat="server" Text="Save" 
                    onclick="BtnUpdate_Click" />&nbsp;&nbsp;
                <asp:Button ID="BtnUpdateView" runat="server" Text="Save and View Customers" 
                    onclick="BtnUpdateView_Click" Width="176px" />&nbsp;<asp:Button 
                    ID="bDelete" runat="server" onclick="bDelete_Click" Text="Delete Customer" />
&nbsp;<asp:Button ID="BtnCancel" CausesValidation="false" runat="server" 
                    Text="Cancel" onclick="BtnCancel_Click" />
                </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>

</asp:Content>
