master
chenwenkai 2 weeks ago
parent 2249b805c5
commit f71f4ce2c4

@ -28752,6 +28752,7 @@ namespace TradeManageNew
CreatorId = pageItem.CreatorId, CreatorId = pageItem.CreatorId,
PublishMessage = pageItem.PublishMessage, PublishMessage = pageItem.PublishMessage,
TrackingCode= pageItem.TrackingCode, TrackingCode= pageItem.TrackingCode,
imgList=pageItem.imgList,
}; };
result.DataSource.Add(resultItem); result.DataSource.Add(resultItem);
} }
@ -30481,6 +30482,18 @@ namespace TradeManageNew
return true; return true;
} }
#endregion #endregion
#region 编辑
[WebMethod(EnableSession = true)]
public int Update_TemuShopGoodActive(TemuShopGoodActive Model)
{
//Pages.Login(this.Session);
Model.State = 1;
Model.CreateTime = DateTime.Now;
Model.CreateUserId = Convert.ToInt32(Session["UserId"]);
return DataNew.Update_TemuShopGoodActive(Model);
}
#endregion
#region 结束活动 #region 结束活动
[WebMethod(EnableSession = true)] [WebMethod(EnableSession = true)]
public bool Update_TemuShopGoodActive(int ID) public bool Update_TemuShopGoodActive(int ID)

@ -7174,7 +7174,7 @@ end
} }
if (!string.IsNullOrEmpty(GoodsCode)) if (!string.IsNullOrEmpty(GoodsCode))
{ {
where += " and GoodsCode='" + GoodsCode + "' "; where += " and GoodsCode like '%" + GoodsCode + "%' ";
} }
if (!string.IsNullOrEmpty(Name)) if (!string.IsNullOrEmpty(Name))
{ {
@ -31117,7 +31117,7 @@ end
#endregion #endregion
#region 保存 #region 保存TemuShopGoodActive
public static int Save_TemuShopGoodActive(TemuShopGoodActive Model) public static int Save_TemuShopGoodActive(TemuShopGoodActive Model)
{ {
string tsql = @" string tsql = @"
@ -31146,6 +31146,8 @@ select @ID";
int a = Convert.ToInt32(db.ExecuteScalar(cmd)); 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])values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum)";
cmd = db.GetSqlStringCommand(tsql); cmd = db.GetSqlStringCommand(tsql);
if (Model.ListModel!=null)
{
foreach (var item in Model.ListModel) foreach (var item in Model.ListModel)
{ {
cmd.Parameters.Clear(); cmd.Parameters.Clear();
@ -31157,9 +31159,65 @@ select @ID";
db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum); db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum);
db.ExecuteNonQuery(cmd); db.ExecuteNonQuery(cmd);
} }
}
return a; return a;
} }
#endregion #endregion
#region 编辑TemuShopGoodActive
public static int Update_TemuShopGoodActive(TemuShopGoodActive Model)
{
string tsql = @"
if @ID>0
begin
Update [TemuShopGoodActive] set [Shopid]=@Shopid,[SKU]=@SKU,[SPUID]=@SPUID,[BasePrice]=@BasePrice,[CreateUserId]=@CreateUserId,[CreateTime]=@CreateTime,[PostPrice]=@PostPrice,[State]=@State where ID=@ID
end
else
select @ID";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
db.AddInParameter(cmd, "@ID", DbType.Int32, Model.ID);
db.AddInParameter(cmd, "@Shopid", DbType.Int32, Model.Shopid);
db.AddInParameter(cmd, "@SKU", DbType.String, Model.SKU);
db.AddInParameter(cmd, "@SPUID", DbType.String, Model.SPUID);
db.AddInParameter(cmd, "@BasePrice", DbType.Decimal, Model.BasePrice);
db.AddInParameter(cmd, "@CreateUserId", DbType.Int32, Model.CreateUserId);
db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, Model.CreateTime);
db.AddInParameter(cmd, "@PostPrice", DbType.Decimal, Model.PostPrice);
db.AddInParameter(cmd, "@State", DbType.Int32, Model.State);
int a = Convert.ToInt32(db.ExecuteScalar(cmd));
tsql = @"
if @Id>0
begin
Update [TemuShopGoodActiveDetail] set [ActiveId]=@ActiveId,[OffNum]=@OffNum,[SalePrice]=@SalePrice,[ActiveNum]=@ActiveNum,[OutNum]=@OutNum where Id=@Id
end
else
begin
INSERT INTO [TemuShopGoodActiveDetail]([ActiveId],[OffNum],[SalePrice],[ActiveNum],[OutNum])values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum)
end";
cmd = db.GetSqlStringCommand(tsql);
if (Model.ListModel != null)
{
foreach (var item in Model.ListModel)
{
cmd.Parameters.Clear();
item.OutNum = 0;
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, "@Id", DbType.Int32, item.Id);
db.ExecuteNonQuery(cmd);
}
}
return a;
}
#endregion
#region 删除 #region 删除
public static void Delete_TemuShopGoodActive(int ID) public static void Delete_TemuShopGoodActive(int ID)
{ {
@ -31334,4 +31392,5 @@ where c.SKU1=@SKU";
} }
#endregion #endregion
} }
} }

@ -7462,6 +7462,8 @@ namespace TradeManageNew
SKU = sku, SKU = sku,
BasePrice = Convert.ToDecimal(tb.Rows[i]["价格"]), BasePrice = Convert.ToDecimal(tb.Rows[i]["价格"]),
CreateUserId = userid, CreateUserId = userid,
CreateTime=DateTime.Now,
State=1,
}; };
goods.Add(md); goods.Add(md);

@ -2063,16 +2063,14 @@ namespace TradeManageNew.OuterService
} }
var orderUsedSalePlatformList = db.DT_OrderUsedSalePlatform.Where(x => var orderUsedSalePlatformList = db.DT_OrderUsedSalePlatform.Where(x =>
input.Ids.Contains(x.Id) input.Ids.Contains(x.Id))
&& x.Status == (UsedSalePlatformStatus)input.Status)
.ToList(); .ToList();
if (orderUsedSalePlatformList.Any()) if (orderUsedSalePlatformList.Any())
{ {
db.DT_OrderUsedSalePlatform.Where(x => db.DT_OrderUsedSalePlatform.Where(x =>
input.Ids.Contains(x.Id) input.Ids.Contains(x.Id))
&& x.Status == (UsedSalePlatformStatus)input.Status)
.Set(x => x.ShippingMethod, ShippingMethod.SelfPickup) .Set(x => x.ShippingMethod, ShippingMethod.SelfPickup)
.Set(x => x.Status, (UsedSalePlatformStatus)input.Status) .Set(x => x.Status, (UsedSalePlatformStatus)input.Status)
.Set(x => x.LastModifierId, input.UserId) .Set(x => x.LastModifierId, input.UserId)

Loading…
Cancel
Save