/// <summary> /// 保存要发送的营收信息 /// </summary> /// <param name="phone"></param> /// <returns></returns> public bool SaveRevenueMsg(Business_WeChatPush_Information weChatPush, Business_WeChatPushDetail_Information weChatPushDetail) { using (SqlSugar.SqlSugarClient _dbMsSql = SugarDao.SugarDao_MsSql.GetInstance()) { bool result = false; try { _dbMsSql.BeginTran(); result = _dbMsSql.Insert <Business_WeChatPush_Information>(weChatPush, false) != DBNull.Value; if (result) { //短信接收者 result = _dbMsSql.Insert <Business_WeChatPushDetail_Information>(weChatPushDetail, false) != DBNull.Value; } _dbMsSql.CommitTran(); } catch (Exception ex) { Common.LogHelper.LogHelper.WriteLog(ex.Message); _dbMsSql.RollbackTran(); } finally { } return(result); } }
public SqlSugarTransaction(SqlSugarClient client) { context = client; context.BeginTran(); }