/// <summary>
/// 执行添加事务
/// </summary>
/// <param name="sqls"></param>
/// <returns></returns>
public int AddList(List<String> sqls)
{
return DbHelperSQL.ExecuteSqlTran(sqls);
}
BLL.cs
/// <summary>
/// 执行添加事务
/// </summary>
/// <param name="sqls"></param>
/// <returns></returns>
public bool AddList(List<M_Pact_ItemMoney> list)
{
List<String> sqls = new List<String>();
foreach (M_Pact_ItemMoney model in list)
{
sqls.Add(@" insert into Pact_ItemMoney(PactCode,ItemName,ItemCent)
values
('" + model.PactCode + @"','" + model.ItemName + @"','" + model.ItemCent + @"')");
}
if (dal.AddList(sqls) > 0)
{
return true;
}
else
{
return false;
}
}
C#执行添加事务
最新推荐文章于 2024-05-20 18:11:50 发布