<%@ Page Language="C#" MasterPageFile="~/AdminMaster.master" AutoEventWireup="true" CodeFile="DefineProjec.aspx.cs" Inherits="DefineProjec" 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_ProjectDes" runat="server" CssClass="Label1" 
                    Text="عنوان پروژه : "></asp:Label>
                        </td>
        <td>
            <asp:TextBox ID="Txt_ProjectDes" runat="server" 
                CssClass="TextNormalAlignLeftDLeft" ValidationGroup="11"></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="Txt_ProjectDes" 
                ErrorMessage="وارد کردن عنوان پروژه الزامی است" ValidationGroup="11">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
                <asp:Label ID="Lbl_CompanyInfo" runat="server" CssClass="Label1" 
                    Text="شرکت متقاضی پروژه : "></asp:Label>
                        </td>
        <td>
            <asp:DropDownList ID="Drp_CompanyInfo" runat="server" CssClass="DropDownList" 
                DataSourceID="LinqDt_CompanyInfo" DataTextField="DefineCompany" 
                DataValueField="CompanyID" ValidationGroup="11">
            </asp:DropDownList>
            <asp:LinqDataSource ID="LinqDt_CompanyInfo" runat="server" 
                ContextTypeName="LSC_WareHouseDataContext" OrderBy="CompanyID desc" 
                Select="new (DefineCompany, CompanyID)" TableName="xtblDefineCompanies">
            </asp:LinqDataSource>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="Drp_CompanyInfo" 
                ErrorMessage="وارد کردن شرکت متقاضی پروژه الزامی است" ValidationGroup="11">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
                            <asp:Button ID="Btn_SabteProgect" runat="server" CssClass="ButtonAdd" 
                                Text="درج در لیست" onclick="Btn_ViewUserOrders_Click" 
                                ValidationGroup="11" />
                        </td>
        <td>
                <asp:Label ID="Lbl_Error" runat="server" CssClass="LabelError"></asp:Label>
                        </td>
    </tr>
    <tr>
        <td colspan="3">
            <uc1:UC_AdminOperatoChecker ID="UC_AdminOperatoChecker1" runat="server" />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                ValidationGroup="11" />
        </td>
    </tr>
    <tr>
        <td colspan="3">
                <asp:GridView ID="Grd_Prjs" runat="server" CssClass="mGrid" 
                    AutoGenerateColumns="False" DataKeyNames="ProjectID" 
                    DataSourceID="LinqDatProj20">
                    <Columns>
                        <asp:CommandField HeaderText="ویرایش" ShowEditButton="True" />
                        <asp:BoundField DataField="ProjectID" HeaderText="کد پروژه" 
                            InsertVisible="False" ReadOnly="True" SortExpression="ProjectID" />
                        <asp:BoundField DataField="CompanyID" HeaderText="کد شرکت" 
                            SortExpression="CompanyID" Visible="False" />
                        <asp:TemplateField HeaderText="نام شرکت متقاضی">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" 
                                    DataSourceID="LinqDt_CompanyInfo" DataTextField="DefineCompany" 
                                    DataValueField="CompanyID" SelectedValue='<%# Bind("CompanyID") %>'>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Str_Cmp") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ProjectDescription" HeaderText="عنوان پروژه" 
                            SortExpression="ProjectDescription" />
                        <asp:BoundField DataField="DateSefaresh" HeaderText="تاریخ سفارش" 
                            SortExpression="DateSefaresh" />
                        <asp:BoundField DataField="DateTahvil" HeaderText="تاریخ تحویل" 
                            SortExpression="DateTahvil" />
                        <asp:CheckBoxField DataField="CloseBit" HeaderText="وضعیت پروژه" 
                            SortExpression="CloseBit" />
                        <asp:CommandField HeaderText="حذف" ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
                <asp:LinqDataSource ID="LinqDatProj20" runat="server" 
                    ContextTypeName="LSC_WareHouseDataContext" EnableDelete="True" 
                    EnableInsert="True" EnableUpdate="True" TableName="tblProjects" 
                    OrderBy="ProjectID desc">
                </asp:LinqDataSource>
        </td>
    </tr>
</table>
</asp:Content>

