protected void PopulateRequestedAds(AdMatch current_match)
        {
            //Create the output table to list requested ads .
            DataTable adList = new DataTable();

            adList.Columns.Add("uploadedad_id");
            adList.Columns.Add("admatch_id");
            adList.Columns.Add("title");
            adList.Columns.Add("data");
            adList.Columns.Add("num_wanted");
            adList.Columns.Add("num_printed");
            adList.Columns.Add("daily_quota");

            foreach (RequestedAd ad_item in current_match.RequestedAdsByadmatch_)
            {

                DataRow new_row = adList.NewRow();

                new_row["uploadedad_id"] = ad_item.uploadedad_id;
                new_row["admatch_id"] = ad_item.admatch_id;
                new_row["title"] = ad_item.uploadedad_.title;
                new_row["data"] = ad_item.uploadedad_.data;
                new_row["num_wanted"] = ad_item.num_wanted;
                new_row["num_printed"] = ad_item.num_printed;
                new_row["daily_quota"] = ad_item.daily_quota;

                adList.Rows.Add(new_row);
            }

            RequestedAdsListView.DataSource = adList;
            RequestedAdsListView.DataBind();
        }
        /// <summary>
        /// Gets a collection of RequestedAd objects by a AdMatch object.
        /// </summary>
        /// <param name="adMatch">adMatch</param>
        /// <param name="orderBy"></param>
        /// <param name="startRowIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRows"></param>
        /// <returns>A collection RequestedAd objects.</returns>
        protected static EntityList<RequestedAd> GetRequestedAdsByadmatch_(AdMatch @admatch_, string orderBy, long startRowIndex, int pageSize, out long totalRows)
        {
            string commandText = @"
            FROM
            [dbo].[RequestedAds]
            WHERE
            [RequestedAds].[admatch_id] = @admatch_id ";

            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(new SqlParameter("@admatch_id", @admatch_.admatch_id));

            return GetList<RequestedAd>(SelectFieldList, commandText, parameters, orderBy, startRowIndex, pageSize, out totalRows);
        }
        /// <summary>
        /// Gets a collection of RequestedAd objects by a AdMatch object.
        /// </summary>
        /// <param name="admatch_">admatch_</param>
        /// <returns>A collection RequestedAd objects.</returns>
        public static EntityList<RequestedAd> GetRequestedAdsByadmatch_(AdMatch @admatch_)
        {
            string commandText = "RequestedAdGetByAdMatch";

            List<SqlParameter> parameters = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@admatch_id", @admatch_.admatch_id));

            return GetList<RequestedAd>(@admatch_, commandText, parameters);
        }
        /// <summary>
        /// Deletes RequestedAd objects by a AdMatch object.
        /// </summary>
        /// <param name="adMatch">adMatch</param>
        public static void DeleteRequestedAdsByadmatch_(AdMatch adMatch)
        {
            string commandText = "RequestedAdDeleteByAdMatch";

            System.Collections.Generic.List<SqlParameter> parameters = new System.Collections.Generic.List<SqlParameter>();
            parameters.Add(new SqlParameter("@admatch_id", adMatch.admatch_id));

            using (SqlHelper helper = new SqlHelper())
            {
                helper.Execute(commandText, CommandType.StoredProcedure, parameters);
            }
        }
        /// <summary>
        /// Create a new RequestedAd object from a AdMatch object.
        /// </summary>
        /// <param name="admatch_">admatch_</param>
        /// <returns>The newly created RequestedAd object.</returns>
        public static RequestedAd CreateRequestedAdByadmatch_(AdMatch @admatch_)
        {
            RequestedAd requestedAd = InitializeNew<RequestedAd>();

            requestedAd.admatch_id = @admatch_.admatch_id;

            requestedAd.admatch_ = @admatch_;

            return requestedAd;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets a collection of PlacedAd objects by a AdMatch object.
        /// </summary>
        /// <param name="adMatch">adMatch</param>
        /// <param name="startRowIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRows"></param>
        /// <returns>A collection PlacedAd objects.</returns>
        public static EntityList<PlacedAd> GetPlacedAdsByadmatch_(AdMatch @admatch_, long startRowIndex, int pageSize, out long totalRows)
        {
            string commandText = @"
            FROM
            [dbo].[PlacedAds]
            WHERE
            [PlacedAds].[admatch_id] = @admatch_id ";

            List<SqlParameter> parameters = new List<SqlParameter>();

            parameters.Add(new SqlParameter("@admatch_id", @admatch_.admatch_id));

            return GetList<PlacedAd>(SelectFieldList, commandText, parameters, null, startRowIndex, pageSize, out totalRows);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Create a new PlacedAd object from a AdMatch object.
        /// </summary>
        /// <param name="admatch_">admatch_</param>
        /// <returns>The newly created PlacedAd object.</returns>
        public static PlacedAd CreatePlacedAdByadmatch_(AdMatch @admatch_)
        {
            PlacedAd placedAd = InitializeNew<PlacedAd>();

            placedAd.admatch_id = @admatch_.admatch_id;

            placedAd.admatch_ = @admatch_;

            return placedAd;
        }