Пример #1
0
        /// <summary>
        /// 广告列表
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public static IPageOfList<AdDeliveryInfo> List(AdSearchSetting setting) {
            FastPaging fp = new FastPaging();
            fp.OverOrderBy = " CreateDateTime DESC";
            fp.PageIndex = setting.PageIndex;
            fp.PageSize = setting.PageSize;
            fp.QueryFields = "*";
            fp.TableName = "AdDelivery";
            fp.PrimaryKey = "Id";
            fp.WithOptions = " WITH(NOLOCK)";

            if(setting.AdPositionId>0){
                fp.Condition = string.Format(" AdPositionId = {0}",setting.AdPositionId);
            }

            IList<AdDeliveryInfo> list = new List<AdDeliveryInfo>();
            AdDeliveryInfo model = null;
            DataTable dt = SQLPlus.ExecuteDataTable(CommandType.Text, fp.Build2005());
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    model = GetByRow(dr);
                    if (model != null)
                    {
                        list.Add(model);
                    }
                }
            }
            int count = Convert.ToInt32(SQLPlus.ExecuteScalar(CommandType.Text, fp.BuildCountSQL()));
            return new PageOfList<AdDeliveryInfo>(list, setting.PageIndex, setting.PageSize, count);
        }
Пример #2
0
 /// <summary>
 /// 广告列表
 /// </summary>
 /// <param name="setting"></param>
 /// <returns></returns>
 public static IPageOfList<AdDeliveryInfo> List(AdSearchSetting setting)
 {
     return AdDeliveryManage.List(setting);
 }
Пример #3
0
 /// <summary>
 /// 广告位列表
 /// </summary>
 /// <param name="setting"></param>
 /// <returns></returns>
 public static IPageOfList<AdPositionInfo> List(AdSearchSetting setting) {
     return AdPositionManage.List(setting);
 }