<%@ page language="C#" masterpagefile="~/MasterPage/UserMasterPage.master" autoeventwireup="true" inherits="Rest_Manage_RestManage_IntegralSetting, DoodiiShop" title="Untitled Page" enableEventValidation="false" viewStateEncryptionMode="Never" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" src="/js/thickbox/thickbox.js"></script>

    <link href="/js/thickbox/thickbox.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
.jftable{
    border-collapse:collapse; border:1px solid #dfdddd; width:100%;
}
.jftable td{ border:1px solid #dfdddd; padding:8px;}
.jftable th{width:30%; font-weight:normal; background-color:#ededed; text-align:left; border:1px solid #dfdddd; padding:8px;}
.toubu{padding:5px 0px 6px 10px; background-color:#2ea2dd; border:1px solid #0e76ab; color:#fff; font-size:14px;}
</style>
    <div id='TB_window' style="display: none;">
    </div>
    <div id='TB_load' style="display: none;">
    </div>
    <div class="toubu" style="">默认积分设置</div><br />
    <table class="jftable" style="">
        <tr>
            <th>
                默认用户注册奖励积分：
            </th>
            <td style="width:40%;">
                <asp:Label ID="lblLoginIntegral" runat="server" Text="100"></asp:Label>
                <asp:TextBox ID="txtLoginIntegral" Visible="false" runat="server" Text="100" Width="43px"
                    MaxLength="5" BorderStyle="Groove"></asp:TextBox>分
                <asp:Button ID="btnLoginIntegralSave" Visible="false" runat="server" Text="保存" OnClick="btnUpdate_Click"
                    Width="64px" />
                <asp:Button ID="btnLoginIntegralCancle" Visible="false" runat="server" Text="取消"
                    Width="64px" OnClick="btnLoginIntegralCancle_Click" />
            </td>
            <td style=" text-align:right; padding-right:20px;">
                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">修改</asp:LinkButton>
            </td>
        </tr>
        <tr>
            <th>
                默认用户订餐奖励积分：
            </th>
            <td>
                1元=<asp:Label ID="lblSuitIntegral" runat="server" Text="100"></asp:Label>
                <asp:TextBox ID="txtSuitIntegral" Visible="false" runat="server" Text="100" Width="43px"
                    MaxLength="5" BorderStyle="Groove"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"></asp:TextBox>分
                <asp:Button ID="btnSuitIntegralSave" Visible="false" runat="server" Text="保存" Width="64px"
                    OnClick="btnSuitIntegralSave_Click" />
                <asp:Button ID="btnSuitIntegralCancle" Visible="false" runat="server" Text="取消" Width="64px"
                    OnClick="btnSuitIntegralCancle_Click" />
            </td>
            <td style=" text-align:right; padding-right:20px;">
                <asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButton2_Click">修改</asp:LinkButton>
            </td>
        </tr>
        <tr>
            <th>
                默认用户虚假订单扣除积分：
            </th>
            <td>
                <asp:Label ID="lblOrderFalse" runat="server" Text="100"></asp:Label>
                <asp:TextBox ID="txtOrderFalse" Visible="false" runat="server" Text="100" Width="43px"
                    MaxLength="5" BorderStyle="Groove"></asp:TextBox>分
                <asp:Button ID="btnOrderFalseSave" Visible="false" runat="server" Text="保存" Width="64px"
                    OnClick="btnOrderFalseSave_Click" />
                <asp:Button ID="btnOrderFalseCancle" Visible="false" runat="server" Text="取消" Width="64px"
                    OnClick="btnOrderFalseCancle_Click" />
            </td>
            <td style=" text-align:right; padding-right:20px;">
                <asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click">修改</asp:LinkButton>
            </td>
        </tr>
    </table><br />
    <div class="toubu">活动积分设置&nbsp;&nbsp;&nbsp;<span style="font-size:12px; color:#b1d7eb;">（例如促销活动等，在特殊时间段内执行的积分政策。）</span></div><br />
    <%--<input id='Button1' type='button' value='添加' onclick="tb_show('添加活动积分设置','AddActiveIntegral.aspx?TB_iframe=true&top=200&height=380&width=600','')"/>--%>
    <div><a href="javascript:AddActiveIntegral(0)"><img src="/images/v6top/tianjiatubiao.gif" alt="添加" /></a></div><br />
    
    <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
            <table class="jftable">
                <tr>
                    <th style="border-right:0px; width:65%;">活动名称：<%#Eval("name") %></th>
                    <th style="border-left:0px; text-align:right; padding-right:20px;"><a href="javascript:AddActiveIntegral(<%#Eval("id") %>)">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
                    href="javascript:delete1(<%#Eval("id") %>,'<%#Eval("name") %>')">删除</a></th>
                </tr>
                <tr>
                    <td style="border-right:0px; padding:8px;"><%#doodii.Utility.Global.GetTimeStr(DateTime.Parse(Eval("startTime").ToString())) %>
                -<%#doodii.Utility.Global.GetTimeStr(DateTime.Parse(Eval("endTime").ToString()))%>
                &nbsp;&nbsp;&nbsp;额外赠送<span style="color:#ff0000;"><%#getIntegral(Eval("Rate").ToString(), Eval("Integral").ToString())%></span>积分</td>
                    <td style="border-left:0px; text-align:right; padding-right:20px;">更新时间：<%#Eval("postTime") %></td>
                </tr>
            </table>
            <br />
        </ItemTemplate>
    </asp:Repeater>
    <div style="width: 243px; float: left; padding-left: 10px;">
        <PageControl:myPageControl ID="MyPageControl1" runat="server" PageSize="10" TotalRecord="20"
             OnChangePageClick="PageControl_Click" IsDoPostBack="true" ItemSize="5"
            PageInfoShow="False" />
    </div>
    <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label>

    <script type="text/javascript">
function AddActiveIntegral(id)
{
    var title="";
    if(id>0)
    {
        title="添加活动积分设置";
    }
    else
    {title="修改活动积分设置";}
    tb_show(title,"IntegralProportionalActivity.aspx?restID=3&ID="+id+"&TB_iframe=true&height=260&width=360&top=150");
}
function delete1(id,name)
{
    var a=confirm("您确定要删除"+name+"活动的积分设置吗？删除后该活动设置将不再有效。");
    if(!a)return;
    var ret=Rest_Manage_RestManage_IntegralSetting.delete1(id).value;
    if(ret=="1")
     {alert("活动删除成功！");location.reload();}
     else
     alert("活动删除失败！");
}
    </script>

</asp:Content>
