/// <summary> /// 添加满额优惠活动范围. /// </summary> /// <param name="promoteMeetAmountScope"> /// Promote_MeetAmount_Scope 的对象实例. /// </param> /// <param name="transaction"> /// 数据事务. /// </param> /// <returns> /// 满额优惠活动范围编号. /// </returns> public int Insert(Promote_MeetAmount_Scope promoteMeetAmountScope, SqlTransaction transaction) { if (promoteMeetAmountScope == null) { throw new ArgumentNullException("promoteMeetAmountScope"); } var parameters = new List<SqlParameter> { this.SqlServer.CreateSqlParameter( "MeetAmountID", SqlDbType.Int, promoteMeetAmountScope.MeetAmountID, ParameterDirection.Input), this.SqlServer.CreateSqlParameter( "Scope", SqlDbType.VarChar, promoteMeetAmountScope.Scope, ParameterDirection.Input), this.SqlServer.CreateSqlParameter( "ReferenceID", SqlDbType.Int, null, ParameterDirection.Output) }; this.SqlServer.ExecuteNonQuery( CommandType.StoredProcedure, "sp_Promote_MeetAmount_Scope_Insert", parameters, null); return (int)parameters.Find(parameter => parameter.ParameterName == "ReferenceID").Value; }
/// <summary> /// 修改满额优惠活动范围. /// </summary> /// <param name="promoteMeetAmountScope"> /// Promote_MeetAmount_Scope 的对象实例. /// </param> /// <param name="transaction"> /// 数据事务. /// </param> public void Update(Promote_MeetAmount_Scope promoteMeetAmountScope, SqlTransaction transaction) { if (promoteMeetAmountScope == null) { throw new ArgumentNullException("promoteMeetAmountScope"); } var parameters = new List<SqlParameter> { this.SqlServer.CreateSqlParameter( "MeetAmountID", SqlDbType.Int, promoteMeetAmountScope.MeetAmountID, ParameterDirection.Input), this.SqlServer.CreateSqlParameter( "Scope", SqlDbType.VarChar, promoteMeetAmountScope.Scope, ParameterDirection.Input) }; this.SqlServer.ExecuteNonQuery(CommandType.StoredProcedure, "sp_Promote_MeetAmount_Scope_Update", parameters, transaction); }