<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="salestrategy_editlist.aspx.cs" Inherits="VA.Modules.JDingMember.sale.salestrategy_editlist" %>

<%@ Import Namespace="System.Data"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>营销策略列表</title>    
    <!--#include virtual="/include/css/editlist.aspx"-->
    <!--#include virtual="/include/js/editlist.aspx"--> 
    <script type="text/javascript">
       
        //添加；
        function add() {
            var shopCode = $("#hfShopCode").val();
            openTopestWindow("添加营销策略", "/modules/member/sale/salestrategy_edit.aspx?shopcode=" + shopCode);
            //openFrameWindow("添加营销策略", 700, 500, "salestrategy_edit.aspx?shopcode=" + shopCode);
        }     
        
        //修改；
        function modify(){            
            if (!checkSelect(true)) {
                return;
            }

            var ids = getCheckedItems();
            openListSingleEditWindow(true, "修改营销策略", "/modules/member/sale/salestrategy_edit.aspx?strategycode=" + ids);
        }        
                
        //删除；
        function del(){
            if (!checkSelect(true)) {
                return;
            }

            batchllyActWrapper("Del", "确定要删除所选项吗？", "");
        }

        //单条修改；
        function smodify(keyValue) {
            var ids = keyValue;
            openTopestWindow("修改营销策略("+ keyValue +")", "/modules/member/sale/salestrategy_edit.aspx?strategycode=" + ids);
            event.stopPropagation();  //阻止事件冒泡，避免行被选中；
        }

        //单条删除；
        function sdel(keyValue) {
            singleActWrapper("Del", keyValue, "确定要删除该项吗？", "");
        }

        //设置营销规则
        function setRules(keyValue) {
            var ids = keyValue;
            openTopestWindow("设置营销规则("+ keyValue +")", "/modules/member/sale/salestrategy_config_nav.aspx?strategycode=" + ids);
            event.stopPropagation();  //阻止事件冒泡，避免行被选中；
        }

        //启用；
        function enable(){            
            batchllyActWrapper("Enable", "", "");
        }

        //停用；
        function disable(){
            batchllyActWrapper("Disable", "", "");
        }

        //单条启用；
        function senable(keyValue) {
            singleActWrapper("Enable", keyValue, "确定要正式启用该策略吗？ 注：正式启用后将不允许再修改！", "");
        }

        //停用；
        function sdisable(keyValue) {
            singleActWrapper("Disable", keyValue, "确定要停用该策略吗？ ", "");
        }

        $(function () {
            initListPage();
        });

    </script>

</head>
<body>
<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div id="pageWrapper" class="pageWrapper">   
    
    <div id="toolBar">                          
        <a href="javascript:add()" class="jtongui-toolbarbutton" icon="icon-add">添加</a>      
        <%--<a href="javascript:enable()" class="jtongui-toolbarbutton" icon="icon-enable">启用</a>        
        <a href="javascript:disable()" class="jtongui-toolbarbutton" icon="icon-disable">停用</a>         --%>
        <a href="javascript:refresh()" class="jtongui-toolbarbutton" icon="icon-reload">刷新</a>            
    </div><!--toolBar.END-->   

    <div id="noteBar">
        <p>注：为了更灵活地支持正常的经营活动，系统允许对已经启用的营销策略进行修改，但请在修改前确认对历史营业数据无异议；</p>
    </div>
                     
    <div id="searchBar">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

        <asp:DropDownList ID="ddlBizType" Runat="server" 
                AutoPostBack="true"
                OnSelectedIndexChanged="ddlBizType_SelectedIndexChanged">
        </asp:DropDownList>

        <asp:DropDownList ID="ddlStatus" Runat="server" 
                AutoPostBack="true"
                OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
        </asp:DropDownList>
                               
        <asp:DropDownList ID="ddlIsValid" runat="server" 
                AutoPostBack="true"
                OnSelectedIndexChanged="ddlIsValid_SelectedIndexChanged">
        <asp:ListItem Value="">是否在期效内</asp:ListItem>
        <asp:ListItem Value="1">在期效内</asp:ListItem>
        <asp:ListItem Value="2">不在期效内</asp:ListItem>
        </asp:DropDownList>                          

        <asp:TextBox ID="txtKeyWords" runat="server"
            CssClass="input keywords"
            Width="180px" />
   
        <asp:Button ID="btnSearch" runat="server" 
             CssClass="simpleBtn"
             Text="查询" 
             Onclick="btnSearch_Click" />
        
        </ContentTemplate>
        </asp:UpdatePanel>

    </div><!--searchBar.END-->    

    <div id="dataBar">

    <!--MainList.Start-->    
    <div class="jtongui-smartlisttable" id="jtongui-smartlisttable">

    <table cellpadding="3" cellspacing="0" class="tableheader" id="tb1_header" >
    <thead>
    <tr>
        <%--<td style="width:30px;text-align:center;"><input type="checkbox" id="ckb_selectAll"/></td>--%>
        <td style="width:60px;text-align:center;">策略代码</td>
        <td style="width:70px;text-align:center;">策略类型</td>
        <td style="width:200px;text-align:center;">策略名称</td>
        <td style="width:70px;text-align:center;">限定人群</td>
        <td style="width:100px;text-align:center;">限定会员级别</td>        
        <td style="width:150px;text-align:center;">有效日期</td>        
        <td style="width:70px;text-align:center;">创建人</td>
        <td style="width:70px;text-align:center;">创建日期</td>        
	    <td style="width:70px;text-align:center;">状态</td>	         
        <td style="width:70px;text-align:center;">营销规则</td>
        <td style="width:30px;text-align:center;">修改</td>	    	 
        <td style="width:70px;text-align:center;">启用/停用</td>	    	 
       <%-- <td style="width:30px;text-align:center;">删除</td>	    --%>	       	          	    
        <td></td>
    </tr>    
    </thead>
    </table>

    <div id="dataBody">
    <asp:Repeater ID="myRepeater" Runat="server" EnableViewState="False"  >
    <HeaderTemplate>
    <div class="bodyContainer">
    <% = base.ShowNoRecordInfo() %>    
    <table cellpadding="3" cellspacing="0" class="tablebody" tbHeader="tb1_header">
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
        <%--<td style="text-align:center;"><input type="checkbox" name="ckb_dataItem" value="<%# Eval("Strategy_Code")%>" /></td>--%>
        <td align="center"><%# Eval("Strategy_Code")%></td>        
        <td align="center"><%# VA.Modules.JDingMember.Core.Enums.SaleStrategyConverter.BizTypeConverter.Convert_Value_ToText(Eval("Biz_Type").ToString(), true)%></td>
        <td align="left"><%# Eval("Strategy_Name")%></td>        
        <td align="center"><%# VA.Modules.JDingMember.Core.Enums.SaleStrategyConverter.LimitCustomerTypeConverter.Convert_Value_ToText(Eval("Limit_Customer_Type").ToString(), true)%></td>
        <td align="center"><%# Eval("Limit_Member_Level")%></td>                        
        <td align="center"><%# String.Format("{0:yyyy.MM.dd}",Eval("Begin_Date"))%> - <%# String.Format("{0:yyyy.MM.dd}",Eval("End_Date"))%></td>
        <td align="center"><%# Eval("Create_Operator_Name")%></td>	    
        <td align="center"><%# String.Format("{0:yyyy-MM-dd}",Eval("Create_Date"))%></td>
        <td align="center"><%# VA.Modules.JDingMember.Core.Enums.SaleStrategyConverter.StrategyStatusConverter.Convert_Value_ToText(Eval("Status").ToString(),true)%></td>                        
        <td align="center">
            <a href="#" onclick="javascript:setRules('<%# Eval("Strategy_Code")%>');"><img src="/app_themes/icons/edit.png" alt="修改"/>  </a>
        </td>              	       	     
        <td align="center">
            <a href="#" onclick="javascript:smodify('<%# Eval("Strategy_Code")%>');"><img src="/app_themes/icons/edit.png" alt="修改"/>  </a>
        </td>              	       	     
      <%--  <td align="center">
            <a href="#" onclick="javascript:sdel('<%# Eval("Strategy_Code")%>');"><img src="/app_themes/icons/delete.png" alt="删除"/>  </a>
        </td>         --%>     	       	 
        <td align="center">
            <%# ShowActIcon(Eval("Strategy_Code").ToString(), Eval("Status").ToString())%>                        
        </td>              	       	         
        <td></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </div><!--bodyContainer.END-->        

    <div id="divPagerInfo" style="display:none">
        <%=base.pageInfo%>
    </div>

    <input type="hidden" id="hidden_pageCnt" value="<% = base.PageCnt%>" />
    <input type="hidden" id="hidden_rdCnt" value="<% = base.RdCnt%>" />
    <input type="hidden" name="chkNum" value="<%=chkNum%>" />

    </FooterTemplate>
    </asp:Repeater>    
    </div><!--dataBody.END-->

    </div><!--jtongui-smartlisttable.END-->        
    <!--MainList.End-->  

    </div><!--dataBar.END-->

    <div id="pagerBar">
       ……
    </div><!--pageNavBar.END-->
    
    <asp:HiddenField runat="server" ID="hfCurrPage" EnableViewState="true" />
    
</div>

<!--添加窗口-->
<div id="winAdd" style="display:none;"></div> 

<asp:HiddenField ID="hfShopCode" runat="server" />

<%
    Response.Write("<script type='text/javascript'>keywords_ToolTip = '"+ base.keywords_ToolTip +"';</script>");    
%>

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