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

<%@ Register src="UC_AdminOperatoChecker.ascx" tagname="UC_AdminOperatoChecker" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%;">
        <tr>
            <td colspan="3">
                <asp:Label ID="Lbl_Title" runat="server" CssClass="LabelHeaader" 
                    Text="لیست اقلام معیوب و مستهلک مرجوعی به انبار"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Lbl_UserName" runat="server" CssClass="Label1" 
                    Text="نام کاربری : "></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="Drp_UserName" runat="server" AutoPostBack="True" 
                    CssClass="DropDownList" DataSourceID="LinqDt_UserName" DataTextField="UserName" 
                    DataValueField="UserName">
                </asp:DropDownList>
                <asp:LinqDataSource ID="LinqDt_UserName" runat="server" 
                    ContextTypeName="LSC_WareHouseDataContext" Select="new (RowID, UserName)" 
                    TableName="tblUsers">
                </asp:LinqDataSource>
            </td>
            <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="انتخاب نام کاربری الزامی می باشد" 
                                ControlToValidate="Drp_UserName" ValidationGroup="11">*</asp:RequiredFieldValidator>
                        </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="Btn_ViewAssetdeliver" runat="server" CssClass="ButtonOk" 
                    onclick="Btn_ViewAssetdeliver_Click" Text="مشاهده" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:GridView ID="Grd_ViewAssetMarjoee" runat="server" 
                    AutoGenerateColumns="False" CssClass="mGrid" 
                    DataSourceID="LinqDt_Marjo" 
                    onselectedindexchanged="Grd_ViewAssetDeliver_SelectedIndexChanged" 
                    EmptyDataText="رکوردی یافته نشد">
                    <Columns>
                        <asp:BoundField DataField="OrderDetailID" HeaderText="کد سفارش" ReadOnly="True" 
                            SortExpression="OrderDetailID">
                        </asp:BoundField>
                        <asp:BoundField DataField="OrderDetailDescription" HeaderText="جزییات سفارش" 
                            ReadOnly="True" SortExpression="OrderDetailDescription" />
                        <asp:BoundField DataField="AssetName" HeaderText="نام کالا" ReadOnly="True" 
                            SortExpression="AssetName" />
                        <asp:BoundField DataField="AssetQuantity" HeaderText="میزان درخواست" 
                            ReadOnly="True" SortExpression="AssetQuantity">
                        </asp:BoundField>
                        <asp:BoundField DataField="AssetUnitDescrition" HeaderText="واحد شمارش" 
                            ReadOnly="True" SortExpression="AssetUnitDescrition">
                        </asp:BoundField>
                        <asp:BoundField DataField="OrderDetailNotes" HeaderText="ملاحظات" 
                            ReadOnly="True" SortExpression="OrderDetailNotes" />
                        <asp:BoundField DataField="OrderDate" HeaderText="تاریخ سفارش" ReadOnly="True" 
                            SortExpression="OrderDate" />
                        <asp:BoundField DataField="DateMarjoee" HeaderText="تاریخ مرجوعی" 
                            ReadOnly="True" SortExpression="DateMarjoee" />
                        <asp:BoundField DataField="StateDescription" HeaderText="وضعیت" 
                            ReadOnly="True" SortExpression="StateDescription" />
                        <asp:BoundField DataField="MarjoeeNote" HeaderText="علت مرجوعی" 
                            ReadOnly="True" SortExpression="MarjoeeNote" />
                        <asp:BoundField DataField="NameSname" HeaderText="نام و نام خانوادگی کاربر" 
                            ReadOnly="True" SortExpression="NameSname" />
                    </Columns>
                </asp:GridView>
                <uc1:UC_AdminOperatoChecker ID="UC_AdminOperatoChecker1" runat="server" />
                <asp:LinqDataSource ID="LinqDt_Marjo" runat="server" 
                    ContextTypeName="LSC_WareHouseDataContext" 
                    Select="new (OrderDetailID, OrderDetailDescription, AssetName, AssetQuantity, OrderDetailNotes, AssetUnitDescrition, OrderDate, DateMarjoee, StateDescription, NameSname, MarjoeeNote)" 
                    TableName="xtblMarjoeeHaDetails" Where="UserName == @UserName">
                    <WhereParameters>
                        <asp:ControlParameter ControlID="Drp_UserName" Name="UserName" 
                            PropertyName="SelectedValue" Type="String" />
                    </WhereParameters>
                </asp:LinqDataSource>
            </td>
        </tr>
    </table>
</asp:Content>

