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

<%@ Register src="UC_LogedInChecker.ascx" tagname="UC_LogedInChecker" 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: left">
                &nbsp;</td>
            <td style="text-align: right">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: left">
                <asp:Label ID="Lbl_WhAsset" runat="server" CssClass="Label1" 
                    Text="عنوان کالا:"></asp:Label>
            </td>
            <td style="text-align: right">
                <asp:DropDownList ID="Drp_WhAsset" runat="server" 
                    DataSourceID="LinqDt_Drp_WhAssets" DataTextField="AssetName" 
                    DataValueField="AssetID">
                </asp:DropDownList>
                <asp:LinqDataSource ID="LinqDt_Drp_WhAssets" runat="server" 
                    ContextTypeName="LSC_WareHouseDataContext" OrderBy="AssetName" 
                    Select="new (AssetID, AssetName)" TableName="tblWhAssets">
                </asp:LinqDataSource>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="Txt_AsseQuantity" 
                    ErrorMessage="انتخاب کالا الزامی می باشد" 
                    ValidationGroup="11">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: left">
                <asp:Label ID="Lbl_AsseCategory" runat="server" CssClass="Label1" 
                    Text="تعداد مورد نیاز:"></asp:Label>
            </td>
            <td style="text-align: right">
                <asp:TextBox ID="Txt_AsseQuantity" runat="server" 
                    CssClass="TextNormalAlignLeftDLeft" ValidationGroup="11"></asp:TextBox>
                </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="Txt_AsseQuantity" 
                    ErrorMessage="ورود تعداد کالا الزامی می باشد" 
                    ValidationGroup="11">*</asp:RequiredFieldValidator>
                <asp:RangeValidator ID="RangeValidator1" runat="server" 
                    ErrorMessage="مقدار وارد شده معتبر نمی باشد" ValidationGroup="11" 
                    ControlToValidate="Txt_AsseQuantity" MaximumValue="999999" MinimumValue="1" 
                    Type="Double">*</asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td style="text-align: left">
                <asp:Label ID="Lbl_AsseCategory0" runat="server" CssClass="Label1" 
                    Text="توضیحات:"></asp:Label>
            </td>
            <td style="text-align: right">
                <asp:TextBox ID="Txt_OrderNotes" runat="server" 
                    CssClass="TextNormalAlignRightDRight" MaxLength="500" ValidationGroup="11"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: left">
                &nbsp;</td>
            <td>
                <asp:Button ID="Btn_Insert" runat="server" CssClass="ButtonAdd" 
                    onclick="Btn_Insert_Click" Text="درج در لیست" ValidationGroup="11" />
                <asp:Button ID="Btn_AddOrder" runat="server" CssClass="ButtonSave" 
                    onclick="Btn_AddOrder_Click" Text="ثبت سفارش" />
            </td>
            <td>
                <asp:Label ID="Lbl_Error" runat="server" CssClass="LabelError"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="text-align: right" colspan="3">
                <uc1:UC_LogedInChecker ID="UC_LogedInChecker1" runat="server" />
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" Width="700px" 
                    ValidationGroup="11" />
            </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="AssetID" 
                    onselectedindexchanged="Grd_OrderDetails_SelectedIndexChanged">
                    <Columns>
                        <asp:CommandField HeaderText="حذف" SelectText="حذف اقلام" 
                            ShowSelectButton="True">
                            <ItemStyle Width="100px" />
                        </asp:CommandField>
                        <asp:TemplateField HeaderText="کد کالا">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("AssetID") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="نام کالا">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("AssetName") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="300px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="تعداد مورد نیاز">
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("AssetQuantity") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="200px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="توضیحات ">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("OrderDetailNotes") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle ForeColor="#E4E4E4" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="text-align: left">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

</asp:Content>

