/// <summary> /// Gets a collection of PlacedAd objects by a Trigger object. /// </summary> /// <param name="trigger">trigger</param> /// <param name="startRowIndex"></param> /// <param name="pageSize"></param> /// <param name="totalRows"></param> /// <returns>A collection PlacedAd objects.</returns> public static EntityList<PlacedAd> GetPlacedAdsBytrigger_(Trigger @trigger_, long startRowIndex, int pageSize, out long totalRows) { string commandText = @" FROM [dbo].[PlacedAds] WHERE [PlacedAds].[trigger_id] = @trigger_id "; List<SqlParameter> parameters = new List<SqlParameter>(); parameters.Add(new SqlParameter("@trigger_id", @trigger_.trigger_id)); return GetList<PlacedAd>(SelectFieldList, commandText, parameters, null, startRowIndex, pageSize, out totalRows); }
/// <summary> /// Deletes PlacedAd objects by a Trigger object. /// </summary> /// <param name="trigger">trigger</param> public static void DeletePlacedAdsBytrigger_(Trigger trigger) { string commandText = "PlacedAdDeleteByTrigger"; System.Collections.Generic.List<SqlParameter> parameters = new System.Collections.Generic.List<SqlParameter>(); parameters.Add(new SqlParameter("@trigger_id", trigger.trigger_id)); using (SqlHelper helper = new SqlHelper()) { helper.Execute(commandText, CommandType.StoredProcedure, parameters); } }
/// <summary> /// Gets a collection of PlacedAd objects by a Trigger object. /// </summary> /// <param name="trigger_">trigger_</param> /// <returns>A collection PlacedAd objects.</returns> public static EntityList<PlacedAd> GetPlacedAdsBytrigger_(Trigger @trigger_) { string commandText = "PlacedAdGetByTrigger"; List<SqlParameter> parameters = new List<SqlParameter>(); parameters.Add(new SqlParameter("@trigger_id", @trigger_.trigger_id)); return GetList<PlacedAd>(@trigger_, commandText, parameters); }
/// <summary> /// Create a new PlacedAd object from a Trigger object. /// </summary> /// <param name="trigger_">trigger_</param> /// <returns>The newly created PlacedAd object.</returns> public static PlacedAd CreatePlacedAdBytrigger_(Trigger @trigger_) { PlacedAd placedAd = InitializeNew<PlacedAd>(); placedAd.trigger_id = @trigger_.trigger_id; placedAd.trigger_ = @trigger_; return placedAd; }