<%@ page language="C#" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_member_ShopComplain, HoWaveVGO" title="投诉管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True"/>  
<script type="text/javascript">
function setButtonActive(flags)
{  
   var _flag=parseInt(flags);
   var ulObj=document.getElementById("M1");  
   for(var i=0;i<ulObj.childNodes.length;i++)
     ulObj.childNodes[i].className="";
   if(ulObj.childNodes.length>3)
     {_flag=_flag*2+1;}
    ulObj.childNodes[_flag].className="active";  

}
</script> 
<style type="text/css">
.showDiv{
 position:absolute;color:#000000; width:280px;background-color:#FFFFFF;
 border:1px solid #CCC;
 padding:5px;
 text-align:left;
}
</style>
<div class="pageTitle">投诉举报管理</div>
<div id="MainMenu">
	<div class="TabMenu">
		<!--一级导航-->				
       <ul id="M1" >
          <li class="active"><asp:LinkButton ID="LinkButton1" runat="server" Text="我的投诉" CommandName="myComplain" OnCommand="IComplain_SelectType" CausesValidation="False" OnClientClick="setButtonActive(0)"/></li>
          <li><asp:LinkButton ID="LinkButton2" runat="server" Text="收到的投诉" CommandName="receiveComplain" OnCommand="IComplain_SelectType" CausesValidation="False" OnClientClick="setButtonActive(1)"/></li>
          <li><asp:LinkButton ID="LinkButton3" runat="server" Text="投诉/举报" CommandName="complainOther" OnCommand="IComplain_SelectType" CausesValidation="False" OnClientClick="setButtonActive(2)"/></li>   
       </ul>
   </div>
   <div class="TabText">
   <br /> 
   
       
           <asp:PlaceHolder ID="PlaceHolder1" runat="server">
             <table class="SearchTableStyle"><tr><td>
                <asp:DropDownList ID="DropType" runat="server" AutoPostBack="True" Height="20px" Width="94px">
                    <asp:ListItem Value="-1">投诉／举报</asp:ListItem>
                   <asp:ListItem Value="投诉">投诉</asp:ListItem>
                    <asp:ListItem Value="举报">举报</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;
                <asp:DropDownList ID="DropStatus" runat="server" AutoPostBack="True" Height="20px" Width="94px">
                     <asp:ListItem Value="状态">状态</asp:ListItem>
                     <asp:ListItem Value="0">待处理</asp:ListItem>
                     <asp:ListItem Value="1">处理完毕</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;
                <asp:DropDownList ID="DropStartTime" runat="server" AutoPostBack="True" Height="20px" Width="104px">
                    <asp:ListItem Value="0">查看近期记录</asp:ListItem>
                    <asp:ListItem Value="1">查看历史记录</asp:ListItem>
                </asp:DropDownList>
             </td></tr></table>
                 <asp:GridView ID="GridView1" runat="server" OnDataBound="GridView1_OnDataBound" DataSourceID="Complainsource1" AllowPaging="True" AutoGenerateColumns="False" CssClass="tableHead" >
                        <Columns>
                            <asp:BoundField HeaderText="编号" DataField="ComplainID" />
                            <asp:BoundField DataField="complainedname" HeaderText="被投诉人" />
                            <asp:BoundField DataField="statusname" HeaderText="状态" />
                          <asp:TemplateField HeaderText="投诉原因" ItemStyle-Width="100px">
                             <ItemTemplate>
                               <asp:Label id="reasonBar" runat="server" Text="查看投诉原因" />
                               <asp:Label ID="TxtReason" runat="server" Text='<%#Eval("reason") %>' style="color:#000000;" />
                             </ItemTemplate>
                          </asp:TemplateField>
                          <asp:TemplateField HeaderText="处理结果" ItemStyle-Width="100px" >
                             <ItemTemplate>
                               <asp:Label id="resultBar" runat="server" Text="查看处理结果" />
                               <asp:Label ID="TxtResult" runat="server" Text='<%#Eval("result") %>' style="color:#000000;" />
                             </ItemTemplate>
                          </asp:TemplateField>
                            <asp:BoundField HeaderText="日期" DataField="StartTime" />
                            <asp:HyperLinkField DataNavigateUrlFields="ComplainID" DataNavigateUrlFormatString="Shop_Complain.aspx?ReviewComplainID={0}"
                                HeaderText="查看 " Text="查看" />
                        </Columns>                      
                        <EmptyDataTemplate >                   
                         <div style="padding:10px;">没有符合查询条件的记录！</div>                          
                        </EmptyDataTemplate>                   
                 </asp:GridView>
           </asp:PlaceHolder>

           <asp:PlaceHolder ID="PlaceHolder2" runat="server" Visible="false">
              <table class="SearchTableStyle"><tr><td>
                 <asp:DropDownList ID="DropType1" runat="server" AutoPostBack="True" Height="20px"  Width="94px">
                    <asp:ListItem Value="-1">投诉／举报</asp:ListItem>
                    <asp:ListItem Value="投诉">投诉</asp:ListItem>
                    <asp:ListItem Value="举报">举报</asp:ListItem>
                  </asp:DropDownList>
              &nbsp;&nbsp; 
                 <asp:DropDownList ID="DropStatus1" runat="server" AutoPostBack="True" Height="20px" Width="94px">
                     <asp:ListItem Value="状态">状态</asp:ListItem>
                     <asp:ListItem Value="0">待处理</asp:ListItem>
                     <asp:ListItem Value="1">处理完毕</asp:ListItem>
                 </asp:DropDownList>
              &nbsp;&nbsp; 
                 <asp:DropDownList ID="DropStartTime1" runat="server" AutoPostBack="True" Height="20px" Width="104px">
                     <asp:ListItem Value="0">查看近期记录</asp:ListItem>
                     <asp:ListItem Value="1">查看历史记录</asp:ListItem>
                 </asp:DropDownList>
              </td></tr></table>
                 <asp:GridView ID="GridView2" runat="server" OnDataBound="GridView2_OnDataBound"  AllowPaging="True" AutoGenerateColumns="False"  DataSourceID="ComplainSource2" CssClass="tableHead">                               
                    <Columns>
                        <asp:BoundField DataField="ComplainID" HeaderText="编号"  HeaderStyle-Width="50px"/>
                        <asp:BoundField HeaderText="投诉人" DataField="userName"  HeaderStyle-Width="50px" /> 
                        <asp:BoundField DataField="statusname" HeaderText="状态"  HeaderStyle-Width="50px"/>
                        <asp:TemplateField HeaderText="投诉原因" ItemStyle-Width="100px" >
                             <ItemTemplate>
                               <asp:Label id="reasonBar" runat="server" Text="查看投诉原因" />
                               <asp:Label ID="TxtReason" runat="server" Text='<%#Eval("reason") %>' style="color:#000000;" />
                             </ItemTemplate>
                          </asp:TemplateField>
                        <asp:TemplateField HeaderText="处理结果" ItemStyle-Width="100px" >
                             <ItemTemplate>
                               <asp:Label id="resultBar" runat="server" Text="查看处理结果" />
                               <asp:Label ID="TxtResult" runat="server" Text='<%#Eval("result") %>' style="color:#000000;" />
                             </ItemTemplate>
                          </asp:TemplateField>
                        <asp:BoundField DataField="StartTime" HeaderText="日期"  HeaderStyle-Width="100px"/>
                        <asp:HyperLinkField DataNavigateUrlFields="ComplainID" DataNavigateUrlFormatString="Shop_Complain.aspx?ReviewComplainID={0}"
                            HeaderText="查看" Text="查看"  HeaderStyle-Width="50px"/>
                    </Columns>
                    <EmptyDataTemplate >                   
                     <div style="padding:10px;">没有符合查询条件的记录！</div>  
                    </EmptyDataTemplate> 
                 </asp:GridView>
           </asp:PlaceHolder>

           <asp:PlaceHolder ID="PlaceHolder3" runat="server" Visible="false">    
              <table class="SearchTableStyle">
                  <tr>
                      <td>类型：</td>
                      <td>
                         <asp:RadioButtonList ID="RadioType" runat="server"  RepeatDirection="Horizontal" >   
                             <asp:ListItem Value="投诉" Selected="True">投诉</asp:ListItem>
                             <asp:ListItem Value="举报">举报</asp:ListItem>
                         </asp:RadioButtonList>
                      </td>
                  </tr>
                  <tr>
                      <td>投诉/举报对象：</td>
                      <td><asp:TextBox ID="TxtComplainUserName" runat="server" Width="250px"/><asp:RequiredFieldValidator ID="Rq2" runat="server" ErrorMessage="投诉的对象不能为空" ControlToValidate="TxtComplainUserName"/></td>
                  </tr>
                  <tr>
                      <td>投诉原因/证据：</td>
                      <td><asp:TextBox ID="TxtReason" runat="server" TextMode="MultiLine" Height="100px" Width="90%"/><asp:RequiredFieldValidator ID="Rq1" runat="server" ErrorMessage="投诉的原因不能为空" ControlToValidate="TxtReason"/></td>
                  </tr>
                  
                  <tr>
                      <td colspan="2" style="text-align:center"><asp:Button ID="ButAdd" runat="server" OnClick="ButAdd_Click" Text="添加" /></td>
                  </tr>
              </table> 
           </asp:PlaceHolder> 
        
       
    </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <br />
 </div></div>  
  <script type="text/javascript">setButtonActive(<%=m_flag %>);</script>  
       
    <asp:ObjectDataSource ID="Complainsource1" runat="server" SelectMethod="GetComplainByStatusUserIDComplainUserIDLatelyDateComplainType"
         TypeName="Shop_Complain" OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropStatus" DefaultValue="状态" Name="Status" PropertyName="SelectedValue"
                Type="String" />
            <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID" Type="Int32" />
            <asp:Parameter DefaultValue="-1" Name="ComplainUserID" Type="Int32" />
            <asp:ControlParameter ControlID="DropStartTime" DefaultValue="0" Name="LatelyDate"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropType" DefaultValue="-1" Name="ComplainType" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
     <asp:ObjectDataSource ID="ComplainSource2" runat="server" SelectMethod="GetComplainByStatusUserIDComplainUserIDLatelyDateComplainType"
           TypeName="Shop_Complain" OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
            <asp:ControlParameter ControlID="DropStatus" DefaultValue="状态" Name="Status" PropertyName="SelectedValue"
                Type="String" />
                <asp:Parameter DefaultValue="-1" Name="UserID" Type="Int32" />
                <asp:SessionParameter DefaultValue="0" Name="ComplainUserID" SessionField="Howave_UserID"
                    Type="Int32" />
            <asp:ControlParameter ControlID="DropStartTime" DefaultValue="" Name="LatelyDate"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropType" DefaultValue="" Name="ComplainType" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
     </asp:ObjectDataSource>
</asp:Content>

