<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ShowUserCar.aspx.cs" Inherits="ShowUserCar" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%;" dir="rtl">
        <tr>
            <td>
                <asp:GridView ID="Grd_Car" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="PelakNumber" DataSourceID="LinqCar" Width="100%">
                    <Columns>
                        <asp:CommandField HeaderText="ویرایش" ShowEditButton="True" />
                        <asp:BoundField DataField="CarID" HeaderText="CarID" InsertVisible="False" 
                            SortExpression="CarID" Visible="False" />
                        <asp:BoundField DataField="CarName" HeaderText="نام خودرو" 
                            SortExpression="CarName" />
                        <asp:BoundField DataField="PelakNumber" HeaderText="شماره پلاک" ReadOnly="True" 
                            SortExpression="PelakNumber" />
                        <asp:BoundField DataField="ShasiNumber" HeaderText="شماره شاسی" 
                            SortExpression="ShasiNumber" />
                        <asp:BoundField DataField="MotorNumber" HeaderText="شماره موتور" 
                            SortExpression="MotorNumber" />
                        <asp:BoundField DataField="DriverUserName" HeaderText="DriverUserName" 
                            SortExpression="DriverUserName" Visible="False" />
                        <asp:BoundField DataField="CarModel" HeaderText="مدل" 
                            SortExpression="CarModel" />
                        <asp:CommandField HeaderText="حذف" ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
                <asp:LinqDataSource ID="LinqCar" runat="server" 
                    ContextTypeName="LSCTamiratDataContext" EnableDelete="True" EnableInsert="True" 
                    EnableUpdate="True" EntityTypeName="" 
                    OrderBy="CarID desc, CarName desc, PelakNumber" TableName="tblCars" 
                    Where="DriverUserName == @DriverUserName">
                    <WhereParameters>
                        <asp:SessionParameter Name="DriverUserName" SessionField="UserName" 
                            Type="String" />
                    </WhereParameters>
                </asp:LinqDataSource>
            </td>
        </tr>
        </table>
</asp:Content>

