diff --git a/TradeManageNew/DD_OrderServiceNew.asmx.cs b/TradeManageNew/DD_OrderServiceNew.asmx.cs
index c0290aa..6021156 100644
--- a/TradeManageNew/DD_OrderServiceNew.asmx.cs
+++ b/TradeManageNew/DD_OrderServiceNew.asmx.cs
@@ -30497,6 +30497,15 @@ namespace TradeManageNew
#endregion
#region 结束活动
[WebMethod(EnableSession = true)]
+ public bool End_TemuShopGoodActiveDetail(int ID)
+ {
+ PagesNew.Login(this.Session);
+ DataNew.End_TemuShopGoodActiveDetail(ID);
+ return true;
+ }
+ #endregion
+ #region 结束活动
+ [WebMethod(EnableSession = true)]
public bool Update_TemuShopGoodActive(int ID)
{
PagesNew.Login(this.Session);
@@ -30576,7 +30585,15 @@ namespace TradeManageNew
{
foreach (var ddmd in dmd)
{
- ActiveInfo +="折扣:"+ddmd.OffNum.Value.ToString() + " 售价:"+ ddmd.SalePrice.Value.ToString() + " 活动库存:"+ ddmd.ActiveNum.Value.ToString() + " 已出订单:"+ ddmd.OutNum.Value.ToString() + "
";
+ string zt = " 活动状态:正常";
+ if(ddmd.State==0)
+ zt = "活动状态:已结束";
+ string rq = " 活动日期:";
+ if(ddmd.SDate!=null)
+ rq += ddmd.SDate.Value.ToString("yyyy-MM-dd HH:mm");
+ if (ddmd.EDate != null)
+ rq +="--"+ddmd.EDate.Value.ToString("yyyy-MM-dd HH:mm");
+ ActiveInfo += "结束活动 折扣:" + ddmd.OffNum.Value.ToString() + " 售价:"+ ddmd.SalePrice.Value.ToString() + " 活动库存:"+ ddmd.ActiveNum.Value.ToString() + " 已出订单:"+ ddmd.OutNum.Value.ToString() +zt+rq+"
";
}
}
omd.ActiveInfo = ActiveInfo;
diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs
index 7def6d1..cccc144 100644
--- a/TradeManageNew/DataNew.cs
+++ b/TradeManageNew/DataNew.cs
@@ -31144,7 +31144,7 @@ select @ID";
db.AddInParameter(cmd, "@PostPrice", DbType.Decimal, Model.PostPrice);
db.AddInParameter(cmd, "@State", DbType.Int32, Model.State);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
- tsql = @"INSERT INTO [TemuShopGoodActiveDetail]([ActiveId],[OffNum],[SalePrice],[ActiveNum],[OutNum])values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum)";
+ tsql = @"INSERT INTO [TemuShopGoodActiveDetail]([ActiveId],[OffNum],[SalePrice],[ActiveNum],[OutNum],State,SDate,EDate)values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum,@State,@SDate,@EDate)";
cmd = db.GetSqlStringCommand(tsql);
if (Model.ListModel!=null)
{
@@ -31152,11 +31152,15 @@ select @ID";
{
cmd.Parameters.Clear();
item.OutNum = 0;
+ item.State = 1;
db.AddInParameter(cmd, "@ActiveId", DbType.Int32, a);
db.AddInParameter(cmd, "@OffNum", DbType.Decimal, item.OffNum);
db.AddInParameter(cmd, "@SalePrice", DbType.Decimal, item.SalePrice);
db.AddInParameter(cmd, "@ActiveNum", DbType.Int32, item.ActiveNum);
db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum);
+ db.AddInParameter(cmd, "@State", DbType.Int32, item.State);
+ db.AddInParameter(cmd, "@SDate", DbType.DateTime, item.SDate);
+ db.AddInParameter(cmd, "@EDate", DbType.DateTime, item.EDate);
db.ExecuteNonQuery(cmd);
}
}
@@ -31230,7 +31234,17 @@ end";
db.ExecuteNonQuery(cmd);
}
#endregion
-
+ #region 删除
+ public static void End_TemuShopGoodActiveDetail(int ID)
+ {
+ string tsql = @"
+ update TemuShopGoodActiveDetail set state=0 where ID=@ID";
+ Database db = DatabaseFactory.CreateDatabase();
+ DbCommand cmd = db.GetSqlStringCommand(tsql);
+ db.AddInParameter(cmd, "@ID", DbType.Int32, ID);
+ db.ExecuteNonQuery(cmd);
+ }
+ #endregion
#region 删除
public static void Update_TemuShopGoodActive(int ID)
{
diff --git a/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx b/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx
index 1a052fc..74413bb 100644
--- a/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx
+++ b/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx
@@ -216,6 +216,7 @@
col = new nblf.ui.DataGridColumn();
col.HeaderText = "活动信息";
col.CellTemplate = "{Bind ActiveInfo}";
+
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
@@ -230,17 +231,7 @@
- col = new nblf.ui.DataGridColumn();
- col.HeaderText = "状态";
- col.CellTemplate = "{Bind State}";
- col.CellFormatter = function (value) {
- switch (value) {
- case 1: return "正常";
- case 0: return "已结束";
- default: return "";
- }
- };
- Array.add(datagrid1.Columns, col);
+
@@ -248,7 +239,7 @@
col.HeaderText = "操作";
col.Width = "160px";
// col.CellTemplate = "编辑 复制 结束活动";
- col.CellTemplate = "复制 结束活动";
+ col.CellTemplate = "复制";
Array.add(datagrid1.Columns, col);
//datagrid1.SetPageSize(20);
@@ -279,13 +270,33 @@
col.HeaderText = "活动库存数量";
col.CellTemplate = "";
Array.add(datagrid2.Columns, col);
+
+ col = new nblf.ui.DataGridColumn();
+ col.HeaderText = "活动开始日期";
+ col.CellTemplate = "";
+ Array.add(datagrid2.Columns, col);
+
+ col = new nblf.ui.DataGridColumn();
+ col.HeaderText = "活动结束日期";
+ col.CellTemplate = "";
+ Array.add(datagrid2.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "已售数量";
//col.CellTemplate = "";
//Array.add(datagrid2.Columns, col);
-
+ //col = new nblf.ui.DataGridColumn();
+ //col.HeaderText = "状态";
+ //col.CellTemplate = "{Bind State}";
+ //col.CellFormatter = function (value) {
+ // switch (value) {
+ // case 1: return "正常";
+ // case 0: return "已结束";
+ // default: return "";
+ // }
+ //};
+ // Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
@@ -430,7 +441,24 @@
});
}
//#endregion
+ function DelHD(id) {
+ if (window.confirm("确定要结束该活动吗?") == false) return;
+ var param = new Object();
+ param.ID = id;
+ WindowLoadModel.Show();
+ $.ajax({
+ url: "../DD_OrderServiceNew.asmx/End_TemuShopGoodActiveDetail",
+ data: Sys.Serialization.JavaScriptSerializer.serialize(param),
+ success: function (data) {
+ WindowLoadModel.Hide();
+ if (data.d == false) { alert("已经使用过,无法删除"); return; }
+ ReadData(); //刷新DataGrid
+ }
+ });
+
+
+ }
//#region
function ImportGoods(FileName) {
var param = new Object();
@@ -477,13 +505,13 @@