<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="directprocurement.aspx.cs" Inherits="Web.cg.show.directprocurement" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>OA标题页</title>
    <link href="/css/css.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="/css/popcalendar.js"></script>
</head>
<body>
    <form id="fom" runat="server">
        <div id ="main-c-03-right" >
            <table cellpadding="0"; cellspacing ="0"; style =" width :100%;background-image: url('/css/images/right_top.png'); background-repeat :repeat-x" >
                <tr>
      <td class  ="main-c-03-right02-top">
                	   <!--这里添加页面标题 -->
                      	    直接采购
                    </td>

                </tr>
            </table>
            <div id="main-c-03-right02-main">

<!--栏目开始 -->
           
            <!--这里添加内容 -->
                <asp:Panel ID="pnApp" runat="server">
		<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                            BorderWidth="1px" CssClass="gv" onrowdatabound="GridView1_RowDataBound" 
                            
          onselectedindexchanging="GridView1_SelectedIndexChanging" Width="100%">
                            <RowStyle BorderWidth="1px" CssClass="gvrow" />
                            <Columns>
                           <asp:BoundField DataField="appiouid" HeaderText="申请编号" ReadOnly="True" />
                                <asp:BoundField DataField="title" HeaderText="项目名称" ReadOnly="True" />
                                <asp:BoundField DataField="budget" HeaderText="预估金额" ReadOnly="True" />
                                <asp:BoundField DataField="department" HeaderText="申请机构" ReadOnly="True" />
                                <asp:BoundField DataField="staffid" HeaderText="申请人编号" ReadOnly="True" />
                                <asp:BoundField DataField="staff" HeaderText="申请人姓名" ReadOnly="True" />
                                <asp:BoundField DataField="applicationdate" HeaderText="申请时间" ReadOnly="True" />
                                <asp:BoundField DataField="state" HeaderText="处理状态" ReadOnly="True" />
                                 <asp:CommandField HeaderText="操作" SelectText="处理" ShowSelectButton="True" />
                            </Columns>
                            <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
                        </asp:GridView>
                    </asp:Panel>

                

<asp:Panel ID="pnApplist" runat="server" Visible="False" >

    <table class ="tablezong"  border = "0"  cellpadding ="" cellspacing ="0" style ="width:100%">
                <tr>
                    <td style =" background-color :White ">
                    <div style = " font-size :large ; font-weight :bold ; text-align :center;width :100%; padding :20px 0px 20px 0px  " >
                        <asp:Label ID="lbTitle" runat="server" ></asp:Label></div>
                               <div style =" text-align :left; margin-bottom :10px ">申请编号：<asp:Label ID="lbAppiouid" runat="server"></asp:Label>
                                   <asp:Label ID="lbFacttotal" runat="server" Visible ="false" >0</asp:Label>
                               </div>
                               <div style =" text-align :left; margin-bottom :10px  ">预估金额：<asp:Label ID="lbBudget" runat="server">0</asp:Label></div> 
                               <div style =" text-align :left; margin-bottom :10px  "> 申请人:<asp:Label ID="lbDepartment" runat="server"></asp:Label> &nbsp;<asp:Label ID="lbStaffid" runat="server"></asp:Label>&nbsp;<asp:Label ID="lbStaff" runat="server"></asp:Label>
                        </div> 
                               <div style =" text-align :left; margin-bottom :10px  ">申请时间：<asp:Label ID="lbApplicationdate" runat="server"></asp:Label></div> 
                               <div style =" text-align :left ; margin-bottom :10px "> 处理状态：<asp:Label ID="lbState" runat="server"></asp:Label></div> 
</td>
                </tr>
                <tr>
                    <td  style =" padding :20px 5px 5px 5px" >
                        <asp:Label ID="lbFujian" runat="server" Text="附件："></asp:Label>
                        <asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="LinkButton"  onclick="BulletedList1_Click"></asp:BulletedList>
                    </td>
                </tr>
              <tr>
                     <td >
                        <div class="td_block">
      <div class="row_title">
                        <asp:Label ID="lbCheckTitle" runat="server" Text="审核进度："></asp:Label>
                          <asp:Label ID="lbCheckerCount" runat="server"  Visible ="false" >0</asp:Label>
                        </div> 

                <asp:DataList ID="dlCheck" runat="server" Width="100%" OnItemDataBound="dlCheck_ItemDataBound" >
              <ItemTemplate>
                       
         <div class=" row_pic ">
                    <asp:Image ID="Image1" runat="server" />
                   </div>

                <div>
                    <asp:Label ID="lbShow" runat="server" ></asp:Label>
                    <asp:Label ID="lbcheckername" runat="server" Visible ="false" Text='<%# Bind("checkername") %>'></asp:Label>
                    <asp:Label ID="lbcheckdecided" runat="server" Visible ="false" Text='<%# Bind("checkdecided") %>'></asp:Label> 
                    <asp:Label ID="lbchecknote"  runat="server" Visible ="false" Text='<%# Bind("checknote") %>'></asp:Label>
                    <asp:Label ID="lbchecktime" runat="server" Visible ="false"    Text='<%# Bind("checktime") %>'></asp:Label></div> 
                
                  <asp:Panel ID="plCheckOver" runat="server" Visible ="false" >
                     <div class="row_pic">
                    <asp:Image ID="Image2" runat="server" />
                   </div>
                      <div>审核结束</div>
                  </asp:Panel>
                  </ItemTemplate>
          </asp:DataList>
</div>   </td>
                </tr>
      <tr>
                    <td>
                       <div class="row_title"> 采购清单：</div> 
                        <asp:GridView ID="gvAppList" runat="server" AutoGenerateColumns="False" 
                            BorderWidth="1px" CssClass="gv" Width="100%" OnRowCancelingEdit="gvAppList_RowCancelingEdit" OnRowEditing="gvAppList_RowEditing" OnRowUpdating="gvAppList_RowUpdating" OnRowCreated="gvAppList_RowCreated">
                            <RowStyle BorderWidth="1px" CssClass="gvrow" />
                            <Columns>
                                 <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" />
                                <asp:BoundField DataField="project" HeaderText="需求物品" ReadOnly="True" />
                                <asp:TemplateField HeaderText="数量">
                                    <ItemTemplate>
                                        <asp:Label ID="lbnumber" runat="server" Text='<%# Bind("number") %>'></asp:Label>
                                           <asp:Label ID="lbunit" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="price" HeaderText="预估单价" ReadOnly="True" />
                                <asp:BoundField DataField="total" HeaderText="预估总价" ReadOnly="True" />
                                <asp:BoundField DataField="user" HeaderText="用途" ReadOnly="True" />

                                 <asp:TemplateField HeaderText="实购物品">
                                     <EditItemTemplate>
                                         <asp:TextBox ID="tbfactproject_e" runat ="server" Text='<%# Eval("factproject") %>' ></asp:TextBox>
                                         <asp:Label ID="lbproject_e" runat="server" Text='<%# Eval("project") %>' Visible ="false" ></asp:Label>
                                     </EditItemTemplate>
                                     <ItemTemplate>
                                         <asp:Label ID="lbfactproject_v" runat="server" Text='<%# Bind("factproject") %>'></asp:Label>
                                     </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="实购数量">
                                    <EditItemTemplate>
                                          <asp:TextBox ID="tbfactnumber_e" runat ="server" Text='<%# Eval("factnumber") %>' Width="60px" ></asp:TextBox>
                                         <asp:Label ID="lbnumber_e" runat="server" Text='<%# Eval("number") %>' Visible ="false" ></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                         <asp:Label ID="lbfactnumber_v" runat="server" Text='<%# Eval("factnumber") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="计量单位">
                                    <EditItemTemplate>
                                   <asp:DropDownList ID="ddlunit_e" runat ="server" ></asp:DropDownList>
                                         <asp:Label ID="lbfactunit_e" runat="server" Text='<%# Eval("unit") %>' Visible ="false" ></asp:Label>
                                        <asp:Label ID="lbunit_e" runat="server" Text='<%# Eval("unit") %>' Visible ="false" ></asp:Label>
                                      </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbfactunit_v" runat="server" Text='<%# Eval("factunit") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                  <asp:TemplateField HeaderText="实购单价">
                                    <EditItemTemplate>
                                          <asp:TextBox ID="tbfactprice_e" runat ="server" Text='<%# Eval("factprice") %>' Width="60px" ></asp:TextBox>
                                         <asp:Label ID="lbprice_e" runat="server" Text='<%# Eval("price") %>' Visible ="false" ></asp:Label>
                                     </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbfactprice_v" runat="server" Text='<%# Eval("factprice") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="facttotal" HeaderText="实购总价" ReadOnly="True" />    
                                 
                                <asp:TemplateField HeaderText="完成状态">
                                    <EditItemTemplate>
                                         <asp:DropDownList ID="ddlstate_e" runat ="server" >
                                             <asp:ListItem></asp:ListItem>
                                             <asp:ListItem >完成</asp:ListItem>
                                         </asp:DropDownList>
                                         <asp:Label ID="lbstate_e" runat="server" Text='<%# Bind("state") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbstate_v" runat="server" Text='<%# Bind("state") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField EditText="更新" HeaderText="更新" ShowEditButton="True" />
                                
                            </Columns>
                            <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
                        </asp:GridView>
                        <div style="text-align :left ;" id="divFinish" runat ="server" > 付款日期：       <asp:TextBox ID="tbPayDate" runat="server" 
                            onclick="popUpCalendar(this,this,'yyyy-mm-dd')" 
                            Width="100px"></asp:TextBox>
                            &nbsp;财务凭证号：<asp:TextBox ID="tbDocId" runat="server" MaxLength="48" Width="220px"></asp:TextBox>
                            &nbsp;<asp:Button ID="btFinish" runat="server" Text="采购完成" OnClick="btFinish_Click" ValidationGroup="finish" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="tbPayDate" Display="Dynamic" ErrorMessage="日期不能为空。" 
                            ForeColor="Red" ValidationGroup="finish"></asp:RequiredFieldValidator>
                        </div>
                            
                            <div style="text-align :right;"><asp:Button ID="btBack" runat="server" Text="返回" OnClick="btBack_Click" /></div>

                    </td>
                </tr>
          
            </table>

        </asp:Panel> 
<!--栏目结束 -->

            </div>
            </div> 
        </form>
    </body>
</html>