|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FriendCode.aspx.cs" Inherits="TradeManage.SysManage.FriendCode" %>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title></title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/textbox.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DateBox.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
|
|
|
|
|
media="screen" />
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
|
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
$("#txt_Num").MaskedTextBox();
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
$("#select_state").bind("change", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
ReadData();
|
|
|
|
|
$("#btn_Del").bind("click", function () {
|
|
|
|
|
DelCode();
|
|
|
|
|
});
|
|
|
|
|
$("#btn_BZ").bind("click", function () {
|
|
|
|
|
SetReamrk();
|
|
|
|
|
});
|
|
|
|
|
$("#btn_Cancel").bind("click", function () {
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '40%',
|
|
|
|
|
'height': '40%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DelCode()
|
|
|
|
|
{
|
|
|
|
|
var list = datagrid1.GetSelectListModel();
|
|
|
|
|
if (list == null || list.length == 0) {
|
|
|
|
|
alert("请选择要删除的邀请码");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.list = list;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "SysManageService.asmx/DeleteFriendCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
alert("删除成功");
|
|
|
|
|
|
|
|
|
|
ReadData();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SetReamrk() {
|
|
|
|
|
var bzList = datagrid1.GetSelectListModel();
|
|
|
|
|
if (bzList == null || bzList.length == 0) {
|
|
|
|
|
alert("请选择要备注的邀请码");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
fopen();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function UpdateReamrk() {
|
|
|
|
|
|
|
|
|
|
var bzList = datagrid1.GetSelectListModel();
|
|
|
|
|
if (bzList == null || bzList.length == 0) {
|
|
|
|
|
alert("请选择要备注的邀请码");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($("#txt_Remark").val() == "")
|
|
|
|
|
{
|
|
|
|
|
alert("请输入备注内容");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var list = new Array();
|
|
|
|
|
$(bzList).each(function () {
|
|
|
|
|
var md = new Object();
|
|
|
|
|
md.Remark = $("#txt_Remark").val();
|
|
|
|
|
md.Id = this.Id;
|
|
|
|
|
Array.add(list, md);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.list = list;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "SysManageService.asmx/UpdateFriendCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
alert("修改完成");
|
|
|
|
|
ReadData();
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "邀请码";
|
|
|
|
|
col.CellTemplate = "<a>{Bind FriendCode}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "生成时间";
|
|
|
|
|
col.CellTemplate = "<a>{Bind CreatTime,yyyy-MM-dd HH:mm}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "使用状态";
|
|
|
|
|
col.CellTemplate = "<a>{Bind UseStateName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "使用时间";
|
|
|
|
|
col.CellTemplate = "<a>{Bind UseTime,yyyy-MM-dd HH:mm}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "使用公司";
|
|
|
|
|
col.CellTemplate = "<a>{Bind CompanyName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "备注";
|
|
|
|
|
col.CellTemplate = "<a>{Bind Remark}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
datagrid1.SetPageSize(50);
|
|
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
|
|
datagrid1.AllowPaging = true;
|
|
|
|
|
datagrid1.Width = "100%";
|
|
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function DelCol(obj) {
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var model = datagrid1.Get_Model(rowindex);
|
|
|
|
|
param.Id = model.Id;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "SysManageService.asmx/DeleteMoney",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
alert("删除成功");
|
|
|
|
|
|
|
|
|
|
datagrid1.Del_Row(rowindex);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
function ReadData() {
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
param.Sdate=null;
|
|
|
|
|
if($("#txt_SDate").val()!="")
|
|
|
|
|
param.Sdate = $("#txt_SDate").val();
|
|
|
|
|
|
|
|
|
|
param.Edate = null;
|
|
|
|
|
if ($("#txt_EDate").val() != "")
|
|
|
|
|
param.Sdate = $("#txt_EDate").val();
|
|
|
|
|
param.Code = $("#txt_Name").val();
|
|
|
|
|
param.State = $("#select_state").val();
|
|
|
|
|
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "SysManageService.asmx/GetListJC_FriendCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
|
|
|
|
|
|
if (window.confirm('确定要生成吗?') == false) return;
|
|
|
|
|
if ($("#txt_Num").val()== "")
|
|
|
|
|
{
|
|
|
|
|
alert("请填写要生成的数量");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
param.Num = $("#txt_Num").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "SysManageService.asmx/CreateCode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
|
|
alert("生成成功");
|
|
|
|
|
|
|
|
|
|
ReadData();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
注册邀请码
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
<div id="test" title="邀请码" style="width:500px; height: 200px;">
|
|
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr> <td class="f1" width="12%">
|
|
|
|
|
备注:
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="4">
|
|
|
|
|
<textarea id="txt_Remark" cols="40" rows="3"></textarea>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="center" colspan="5">
|
|
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保 存" onclick="UpdateReamrk();"/> <input
|
|
|
|
|
id="btn_Cancel" type="button" class="btnClass btnClassClose" value="关 闭" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<table id="tb1" class="tableAll" style="width:100%;" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
生成<input id="txt_Num" type="text" min='1' max='100' precision='0' class="editTextbox" style="width: 50px;" />个邀请码(FriendCode)<font color="red">每次最多生成100个</font>
|
|
|
|
|
<input id="btn_code" class="btnClass btnClassFind" type="button" value="确定生成" onclick="save()"/></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="18%">邀请码(FriendCode):
|
|
|
|
|
|
|
|
|
|
</td> <td width="25%"> <input id="txt_Name" class="editTextbox" style="width: 120px;" type="text" />
|
|
|
|
|
|
|
|
|
|
</td> <td class="f1" width="18%">使用状态:
|
|
|
|
|
|
|
|
|
|
</td> <td width="25%">
|
|
|
|
|
<select id="select_state" class="selectClass" name="D5" style="width:120px">
|
|
|
|
|
<option value="-1">全部</option>
|
|
|
|
|
<option value="0">未使用</option>
|
|
|
|
|
<option value="1">已使用</option>
|
|
|
|
|
</select>
|
|
|
|
|
</td> <td>
|
|
|
|
|
|
|
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="18%">生成时间:</td> <td colspan="3">
|
|
|
|
|
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 100px;" type="text" />-<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 100px;" type="text" /></td> <td></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
<input id="btn_Del" class="btnClass btnClassDel" type="button" value="删除" /> <input id="btn_BZ" class="btnClass btnClassEdit" type="button" value="备注" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="5">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|