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

<%@ Register src="US_MainAdminChecker.ascx" tagname="US_MainAdminChecker" 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_CompanyHnits" runat="server" CssClass="Label1" 
                    Text="عنوان واحد شرکت:"></asp:Label>
            </td>
            <td style="text-align: right">
                <asp:TextBox ID="Txt_CompanyUnits" runat="server" 
                    CssClass="TextNormalAlignLeftDLeft" ValidationGroup="11"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="Txt_CompanyUnits" 
                    ErrorMessage="ورود عنوان واحد شرکت الزامی می باشد" ValidationGroup="11">*</asp:RequiredFieldValidator>
            </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" />
            </td>
            <td>
                <asp:Label ID="Lbl_Error" runat="server" CssClass="LabelError"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="text-align: right" colspan="3">
                <uc1:US_MainAdminChecker ID="US_MainAdminChecker1" 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_CompanyUnits" runat="server" CssClass="mGrid" 
                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                    DataKeyNames="CompanyUnitID" DataSourceID="LinqDtCompanyUnits" 
                    PageSize="20">
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True">
                            <ItemStyle Width="50px" />
                        </asp:CommandField>
                        <asp:BoundField DataField="CompanyUnitID" HeaderText="کد واحد" 
                            InsertVisible="False" ReadOnly="True" SortExpression="CompanyUnitID">
                            <ItemStyle Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CompanyUnitName" HeaderText="عنوان واحد شرکت" 
                            SortExpression="CompanyUnitName" />
                        <asp:CommandField ShowEditButton="True">
                            <ItemStyle Width="50px" />
                        </asp:CommandField>
                    </Columns>
                    <HeaderStyle ForeColor="#E4E4E4" />
                </asp:GridView>
                <asp:LinqDataSource ID="LinqDtCompanyUnits" runat="server" 
                    ContextTypeName="LSC_WareHouseDataContext" OrderBy="CompanyUnitID desc" 
                    TableName="tblCompanyUnits" EnableDelete="True" EnableUpdate="True">
                </asp:LinqDataSource>
            </td>
        </tr>
        <tr>
            <td style="text-align: left">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

