<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_Member_shop_review, WebApp_deploy" title="信用评价" enableviewstate="true" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
function setButtonActive()
{
   var _flag=parseInt(<%=m_flag %>);
   var ulObj=document.getElementById("M1");  
   for(var i=0;i<ulObj.childNodes.length;i++)
     ulObj.childNodes[i].className="";
   if(ulObj.childNodes.length>5)
     {_flag=_flag*2+1;} 
    ulObj.childNodes[_flag].className="active";  

}
    </script>

    <div class="pageTitle">
        我的评价</div>
    <div style="width: 98%">
        <%--    <div style="float:left; width:200px; height:350px; margin:5px;">
      <table  class="tableHead" style="height:345px">
         <tr>
             <th>个人信息</th>
         </tr>
          <tr>
             <td  style="background:#F8F8F8; padding:5px;">
               
               卖家好评率： <asp:Label ID="Labwellpurchaserperson" runat="server"  CssClass="font_orange_14" /><br />
               买家好评率： <asp:Label ID="Labwellbargainorperson" runat="server"  CssClass="font_orange_14"/><br /> 
            </td>
         </tr>
      </table>          
    </div>--%>
        <!--信用度-->
        <%--<div style="float:left;  width:72% !Important;width:auto; margin-top:5px;;">
        
      
      
        <asp:HyperLink ID="BuyerReviewUrl" runat="server" Text="&nbsp;卖家信用度"   Target="_blank"/>
        <asp:Label ID="BuyerReviewNums" runat="server" />      
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="ReviewDataSource0"
            OnDataBound="GridView2_DataBound" CssClass="tableHead" RowStyle-HorizontalAlign="Center" >
            <Columns>
                <asp:TemplateField HeaderText="等级">                
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Bind("StarImageURL") %>' />
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Star") %>'/>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Nearweek" HeaderText="最近一个星期" />
                <asp:BoundField DataField="NearMonth" HeaderText="最近一个月" />
                <asp:BoundField DataField="NearSixMonth" HeaderText="最近六个月" />
                <asp:BoundField DataField="PreSixMonth" HeaderText="六个月前" />
                <asp:BoundField DataField="CountStar" HeaderText="总计" />
            </Columns>         
        </asp:GridView>
         <br />
        <asp:HyperLink ID="SalerReviewUrl" runat="server" Text="&nbsp;买家信用度" Target="_blank"/>
        <asp:Label ID="SalerReviewNums" runat="server" />  
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ReviewDataSource"
            OnDataBound="GridView1_DataBound"  CssClass="tableHead" RowStyle-HorizontalAlign="Center">
            <Columns>
                <asp:TemplateField HeaderText="等级">             
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Bind("StarImageURL") %>' />
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Star") %>'/>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Nearweek" HeaderText="最近一个星期" />
                <asp:BoundField DataField="NearMonth" HeaderText="最近一个月" />
                <asp:BoundField DataField="NearSixMonth" HeaderText="最近六个月" />
                <asp:BoundField DataField="PreSixMonth" HeaderText="六个月前" />
                <asp:BoundField DataField="CountStar" HeaderText="总计" />
            </Columns>                       
        </asp:GridView>
    
    </div> 
 </div>--%>
        <div class="clear">
        </div>

        
        <!--评价内容区-->
        <div id="MainMenu">

            <div class="TabText">
            <table width="100%">
            <tr>
            <td width="50%"><asp:RadioButtonList ID="Review_Star_Select" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Review_Star_Select_SelectedIndexChanged"
                    RepeatDirection="Horizontal">
                    <asp:ListItem Value="1">所有评价</asp:ListItem>
                    <asp:ListItem Value="2">所有好评</asp:ListItem>
                    <asp:ListItem Value="3">所有中评</asp:ListItem>
                    <asp:ListItem Value="4">所有差评</asp:ListItem>
                </asp:RadioButtonList></td>
                <td>                审核：
                <asp:DropDownList ID="DropDownList_State" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DropDownList_State_SelectedIndexChanged" >
                <asp:ListItem Value="2">－全部－</asp:ListItem>
                <asp:ListItem Value="1">通过</asp:ListItem>
                <asp:ListItem Value="0">未通过</asp:ListItem>
                </asp:DropDownList></td>
            </tr>
            </table>
                



            </div>

            <div align="center">
                <asp:GridView ID="GridViewReview" runat="server" AutoGenerateColumns="False" CssClass="ReviewListStyle"
                    BorderWidth="1" Width="100%" 
                    onrowcommand="GridViewReview_RowCommand">
                    <Columns>
                        <asp:TemplateField ControlStyle-Width="50px">
                            <ItemTemplate>
                                <input name='id' type='checkbox' onclick='unselectall()' id='id' value='<%# Eval("Id") %>'>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>
                            </HeaderTemplate>
                            <HeaderStyle Width="4%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="编号">
                            <ItemTemplate>
                                <asp:Label ID="Label_Name" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="评论用户">
                            <ItemTemplate>
                                <asp:Label ID="Label_Type" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="评论对象">
                            <ItemTemplate>
                                <asp:Label ID="Label_Methods" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="评论时间" ControlStyle-Width="200">
                            <ItemTemplate>
                                <asp:Label ID="Label_Value" runat="server" Text='<%# Eval("DateTime") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="审核">
                            <ItemTemplate>
                                <asp:Label ID="Label_State" runat="server" Text='<%# Convert.ToBoolean(Eval("State"))==true?"通过":"未通过"%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton_Search" runat="server" CommandName="_Search" CommandArgument='<%# Eval("Id") %>' Text="查看详情"></asp:LinkButton>
                                ｜
                                <asp:LinkButton ID="LinkButton_Delete" ForeColor="Red" OnClientClick="return confirm('确定要删除么?')"
                                    CommandName="_Delete" CommandArgument='<%# Eval("Id") %>' runat="server" Text="删除" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <tr align="center">
                            <td colspan="8">
                                找不到相关数据！
                            </td>
                        </tr>
                    </EmptyDataTemplate>
                </asp:GridView>

            </div>
             <br />
             <div align="center">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                        CurrentPageButtonPosition="Center" CustomInfoHTML="第 %CurrentPageIndex% 页，共%PageCount%页，每页%PageSize%条"
                        FirstPageText="首页" LastPageText="尾页" LayoutType="Table" NextPageText="下一页" PageIndexBoxType="DropDownList"
                        PagingButtonLayoutType="Span" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        SubmitButtonText="Go" TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到">
                    </webdiyer:AspNetPager>
             </div>
                       <div align="center">                  
          <asp:Button ID="Button_Delete"　OnClientClick="return confirm('您确定要删除吗?')" 
                   runat="server" Text="删除评论" CommandName="_Delete" 
                   oncommand="UserButtonOnCommon" />
          <asp:Button ID="Button_Success" runat="server" Text="通过审核" CommandName="_Success" oncommand="UserButtonOnCommon"  />
          <asp:Button ID="Button_Error" runat="server" Text="拒绝审核" CommandName="_Error" oncommand="UserButtonOnCommon"  />
      </div>
            
            <br />
            <br />
            <!--评论详情-->
            <div class="TabText" id="DetailDiv" runat="server" visible="false">
                <table width="99%">
                    <tr>
                        <td align="left">
                            <b>
                                <asp:Label ID="Label_UserName" runat="server" Text=""></asp:Label></b> &nbsp;于
                            &nbsp;
                            <asp:Label ID="Label_DateTime" runat="server" Text=""></asp:Label>&nbsp;对&nbsp;<b><asp:Label
                                ID="Label_ProductName" runat="server" Text=""></asp:Label></b>&nbsp;发表评论
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <hr color="#bb2200" size="1" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div align="left" style="overflow: hidden; word-break: break-all;">
                                <asp:Label ID="Label_Content" runat="server" Text=""></asp:Label>
                            </div>
                            <div align="right" style="text-align: right">
                                <b>评论等级:</b>
                                <asp:Label ID="Label_Level" runat="server" Text=""></asp:Label>
                            </div>
                            &nbsp; &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:Button ID="Button_Show" runat="server" Text="允许显示" 
                                onclick="Button_Show_Click" />
                            &nbsp;
                            <asp:Button ID="Button_Hidden" runat="server" Text="设为隐藏" 
                                onclick="Button_Hidden_Click" />
                            &nbsp;</td>
                    </tr>
                </table>
            </div>
            <br />

            <script type="text/javascript">
function unselectall(){
    if(document.myform.chkAll.checked){
        document.myform.chkAll.checked = document.myform.chkAll.checked&0;
       
    }
}
function CheckAll(form){
    for (var i=0;i<form.elements.length;i++){
        var e = form.elements[i];

        if (e.Name != 'chkAll'&&e.disabled==false)
        e.checked = form.chkAll.checked;
    }
}
            </script>

        </div>
        <asp:ObjectDataSource ID="ReviewDataSource" runat="server" SelectMethod="GetbargainorReviewCount"
            TypeName="HoWave.Web.Shop_Review">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ReviewDataSource0" runat="server" SelectMethod="GetpurchaserReviewCount"
            TypeName="HoWave.Web.Shop_Review">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:HiddenField ID="H_Review_Type" runat="server" Value="-1" />
        <asp:HiddenField ID="H_Review_Star" runat="server" Value="-2" />
        <asp:HiddenField ID="H_Review_UserID" runat="server" />
        <asp:HiddenField ID="H_Review_ReviewerID" runat="server" />
        <asp:HiddenField ID="H_SelectType" runat="server" />

        <script type="text/javascript"></script>
</asp:Content>
