<%@ Page Language="C#" MaintainScrollPositionOnPostback="true"  AutoEventWireup="true" CodeBehind="appform_all_list.aspx.cs" Inherits="Portal.Portal.appform_all_list" MasterPageFile="~/Portal/default.Master" %>
<%@ Register src="../UserControls/Menu.ascx" tagname="Menu" tagprefix="uc1" %>

 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <uc1:Menu ID="Menu1" runat="server" />

 <style>
 .pg a{ display:inline-block; width:40px;}
  .pg span{ display:inline-block; width:40px;}
 </style>
 
 <div class="appform_body">
 <div style=" margin-left:5px">

    <fieldset style=" padding:10px;" class="form-inline">
    <legend style="font-size:13px; font-weight:bold"> 添加搜索 </legend>
 提交人<asp:TextBox ID="txt_username" CssClass="form-control" runat="server"></asp:TextBox> 
 流水号<asp:TextBox ID="txt_orderno" CssClass="form-control" runat="server"></asp:TextBox> 
  表单名称<asp:TextBox ID="txt_title" CssClass="form-control"  runat="server"></asp:TextBox>
     <asp:Button ID="btn_search" runat="server" Text="搜索"  CssClass="btn btn-sm btn-primary"/>
  
  </fieldset>

  <div  style=" margin:8px;">
      <asp:Button ID="btn_del" runat="server"  OnClientClick="if(isselect()) return true; return false;" Text="批量删除" class="btn btn-danger"  onclick="btn_del_Click" />
     
           <asp:Button ID="btn_isfull" runat="server"  OnClientClick="if(isselect()) return true; return false;" Text="标记资料完备" class="btn"  Visible="false" onclick="btn_isfull_Click" />
                      <asp:Button ID="btn_isnotfull" runat="server"  OnClientClick="if(isselect()) return true; return false;" Text="标记不完备" class="btn"  Visible="false" onclick="btn_isnotfull_Click" />

            
     
  </div>

<div class="thelist"    id="thetable">
  
  
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False"   
        DataKeyNames="uid"  Width="100%"   PageSize="20"
        GridLines="None"
        DataSourceID="SqlDataSource1"   
      CssClass="table table-hover" OnRowDataBound="GridView1_RowDataBound"
       
      >
        
    
     <Columns>
           
  <asp:TemplateField     > 
        <HeaderTemplate> 
             <asp:CheckBox ID="chk_SelectedHeader" runat="server" AutoPostBack="False" onclick="selectall(this)" 
                            Text="全选" /> 
      </HeaderTemplate> 
                            
               <ItemTemplate  > 
                   <input type="checkbox"  class="ck_item"   value='<%# Eval("id") %>'  /> <%# Eval("id")%>
                    
              </ItemTemplate>              
        <ItemStyle CssClass="td_id" />
          </asp:TemplateField>
           
           
             <asp:TemplateField     > 
        <HeaderTemplate> 
          状态
      </HeaderTemplate> 
                            
               <ItemTemplate  > 
              <asp:Label runat="server" ID="lbl_process"></asp:Label>  
              </ItemTemplate>              
        <ItemStyle CssClass="td_id" />
          </asp:TemplateField>
          
                       
     

             <asp:TemplateField     > 
        <HeaderTemplate> 
          审批
      </HeaderTemplate> 
                            
               <ItemTemplate  > 
              <asp:Label runat="server" ID="lbl_auditstatus"></asp:Label>
              </ItemTemplate>              
        <ItemStyle  />
          </asp:TemplateField>

 

         
            <asp:BoundField DataField="orderno" HeaderText="流水号" 
                SortExpression="orderno"  /> 
           
            <asp:BoundField DataField="title" HeaderText="表单名称" 
                SortExpression="title"  /> 

            <asp:BoundField DataField="username" HeaderText="提交人" 
                SortExpression="username"  />
                  


                      <asp:TemplateField   HeaderStyle-Width="200px"   > 
        <HeaderTemplate> 
          操作
      </HeaderTemplate> 
                            
               <ItemTemplate  > 
           
      
     
         <input   type="button" value="提交审批"    class="btn btn-flat btn-sm  btn-info"   onclick="openPop('appform_auditpeople.aspx?id=<%#Eval("id") %>    &treeid=<%#Eval("treeid") %>    ','提交审批'); return false;" />
  
      
       <a   target="_blank"    class="btn btn-flat btn-sm bg-maroon"  href='AppformDetail.aspx?id=<%#Eval("id") %>&treeid=<%#Eval("treeid")%>&activeid=<%#Eval("activeid") %>'>查看</a>

        <a   target="_blank"    class="btn btn-flat btn-sm bg-green"  href='AppForm_Print.aspx?id=<%#Eval("id") %>&treeid=<%#Eval("treeid")%>&activeid=<%#Eval("activeid") %>'>打印</a>

 


 
              </ItemTemplate>              
   
          </asp:TemplateField>


      </Columns>
 
 
  


<PagerSettings   PreviousPageText="上一页"  NextPageText="下一页" PageButtonCount="5"  Mode="NumericFirstLast"/>
 
    </asp:GridView>

  </div>
  
  
  
  
  
  
  
  
  
  
    <asp:SqlDataSource ID="SqlDataSource1" 
    
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    runat="server" 
    DeleteCommand="DELETE FROM [users_users] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [users_users] ([username], [displayname], [Tel], [email], [StaffCode], [Office], [Department]) VALUES (@username, @displayname, @Tel, @email, @StaffCode, @Office, @Department)" 
        ProviderName="System.Data.SqlClient" 
        SelectCommand=" select * from v_pagevote where 1=1 and (@name='' or username like '%'+@name+'%') and  (@orderno='' or orderno =@orderno ) and  (@title='' or title like '%'+@title+'%') order by id desc  " 
        UpdateCommand="UPDATE [users_users] SET [username] = @username, [displayname] = @displayname, [Tel] = @Tel, [email] = @email, [StaffCode] = @StaffCode, [Office] = @Office, [Department] = @Department WHERE [uid] = @uid">
       
       
       
        <SelectParameters>
        <asp:ControlParameter ControlID="txt_username" ConvertEmptyStringToNull=false Name="name" />
        <asp:ControlParameter ControlID="txt_orderno" ConvertEmptyStringToNull=false Name="orderno" /> 
        <asp:ControlParameter ControlID="txt_title" ConvertEmptyStringToNull=false Name="title" /> 
        </SelectParameters>

    </asp:SqlDataSource>
   


   <script>
        

       function openRole() {
           var _uid = $("#hf_ids").val();

           ShowIframeNoScroll("setright.aspx?uids=" + _uid, "500", "350", "设置角色");

       }

       function openUser() {
           var _uid = $("#hf_ids").val();

           ShowIframeNoScroll("EditUser_batch.aspx?uids=" + _uid, "800", "350", "批量修改用户信息");

       }


   </script>
      
    
    <input type="hidden" name="hf_ids" id="hf_ids" />





    <script>
        SetC("L5");

        function openPop(url, title) {
            $.layer({
                type: 2,
                title: title,
                fix: true,
                iframe: { src: url },
                offset: ['100px', '50%'],
                area: ['600px', '450px'],
                success: function () {

                }
            });
        }

</script>

</div>
</div>

   </asp:Content>