<%@ Page Language="C#" MasterPageFile="~/AdminMaster.master" AutoEventWireup="true" CodeFile="TahvileSefaresh.aspx.cs" Inherits="TahvileSefaresh" 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 style="text-align: left" colspan="3">
                <asp:Label ID="Lbl_Title" runat="server" CssClass="LabelHeaader" 
                    Text="تحویل اقلام درخواستی به درخواست کننده کالا از انبار"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="text-align: right" colspan="3">
                <table style="width:100%;">
                    <tr>
                        <td class="style1">
                <asp:Label ID="Lbl_AssetUnit" runat="server" CssClass="Label1" 
                    Text="نام کاربری:"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="Drp_Users" runat="server" CssClass="DropDownList" 
                                Width="200px" ValidationGroup="11" AutoPostBack="True" 
                                DataSourceID="LinqDt_Drp_UsersPurchedNotDeliver" DataTextField="UserName" 
                                DataValueField="UserName">
                            </asp:DropDownList>
                            <asp:LinqDataSource ID="LinqDt_Drp_UsersPurchedNotDeliver" runat="server" 
                                ContextTypeName="LSC_WareHouseDataContext" OrderBy="UserName" 
                                TableName="xtblUsersPurchedNotDelivers">
                            </asp:LinqDataSource>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="انتخاب نام کاربری الزامی می باشد" 
                                ControlToValidate="Drp_Users" ValidationGroup="11">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                <asp:Label ID="Lbl_AssetUnit0" runat="server" CssClass="Label1" 
                    Text="جزئیات سفارشات:"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="Drp_OrdersDetail" runat="server" 
                                DataSourceID="LinqDt_Drp_OrdDetailsPuchedNotDeliver" 
                                DataTextField="OrderDetailDescription" DataValueField="OrderDetailID">
                            </asp:DropDownList>
                            <asp:LinqDataSource ID="LinqDt_Drp_OrdDetailsPuchedNotDeliver" runat="server" 
                                ContextTypeName="LSC_WareHouseDataContext" 
                                Select="new (OrderDetailID, OrderDetailDescription)" 
                                TableName="xtblOrderDetailsPurcehdNotDelivereds" Where="UserName == @UserName">
                                <WhereParameters>
                                    <asp:ControlParameter ControlID="Drp_Users" Name="UserName" 
                                        PropertyName="SelectedValue" Type="String" />
                                </WhereParameters>
                            </asp:LinqDataSource>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style1">
                <asp:Label ID="Lbl_DeliverUser" runat="server" CssClass="Label1" 
                    Text="تحویل گیرنده:"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="Drp_Deli_User" runat="server" CssClass="DropDownList" 
                                DataSourceID="LinqDt_DeivUsers" DataTextField="UserName" DataValueField="RowID">
                            </asp:DropDownList>
                            <asp:LinqDataSource ID="LinqDt_DeivUsers" runat="server" 
                                ContextTypeName="LSC_WareHouseDataContext" OrderBy="UserName" 
                                Select="new (RowID, UserName)" TableName="tblUsers">
                            </asp:LinqDataSource>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style1">
                            &nbsp;</td>
                        <td>
                            <asp:Button ID="Btn_ViewUserOrders" runat="server" CssClass="ButtonAdd" 
                                Text="درج در لیست" onclick="Btn_ViewUserOrders_Click" 
                                ValidationGroup="11" />
                            <asp:Button ID="Btn_Save" runat="server" CssClass="ButtonSave" 
                                onclick="Btn_Save_Click" Text="ثبت نهایی" />
                        </td>
                        <td>
                <asp:Label ID="Lbl_Error" runat="server" CssClass="LabelError"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            &nbsp;</td>
                        <td>
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                                ValidationGroup="11" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="text-align: center" colspan="3">
                <asp:GridView ID="Grd_OrderDetails" runat="server" CssClass="mGrid" 
                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                    PageSize="20" DataKeyNames="OrderDetailID" 
                    onselectedindexchanged="Grd_AssetUnits_SelectedIndexChanged">
                    <Columns>
                        <asp:CommandField HeaderText="حذف از لیست" SelectText="حذف" 
                            ShowSelectButton="True">
                            <ItemStyle Width="120px" />
                        </asp:CommandField>
                        <asp:TemplateField HeaderText="کد جزئیات سفارش">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("OrderDetailID") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="150px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="جزئیات سفارش">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("OrderDescription") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle ForeColor="#E4E4E4" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="text-align: center" colspan="3">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: left" colspan="3">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: left">
                &nbsp;</td>
            <td>
                <uc1:UC_AdminOperatoChecker ID="UC_AdminOperatoChecker1" runat="server" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

