Esempio n. 1
0
        private void GetList(HttpContext context)
        {
            int                num                = 1;
            int                num2               = 10;
            int                num3               = 0;
            string             empty              = string.Empty;
            DateTime?          nullable           = null;
            DateTime?          nullable2          = null;
            AppPushRecordQuery appPushRecordQuery = new AppPushRecordQuery();

            nullable  = base.GetDateTimeParam(context, "StartDate");
            nullable2 = base.GetDateTimeParam(context, "EndDate");
            empty     = context.Request["PushStatus"];
            if (!string.IsNullOrEmpty(context.Request["PushStatus"]))
            {
                appPushRecordQuery.PushStatus = (EnumPushStatus)empty.ToInt(0);
            }
            empty = context.Request["PushType"];
            if (!string.IsNullOrEmpty(context.Request["PushType"]))
            {
                appPushRecordQuery.PushType = (EnumPushType)empty.ToInt(0);
            }
            appPushRecordQuery.StartDate = nullable;
            appPushRecordQuery.EndDate   = nullable2;
            appPushRecordQuery.PageIndex = base.CurrentPageIndex;
            appPushRecordQuery.PageSize  = base.CurrentPageSize;
            DataGridViewModel <AppPushRecordInfo> dataList = this.GetDataList(appPushRecordQuery);
            string s = base.SerializeObjectToJson(dataList);

            context.Response.Write(s);
            context.Response.End();
        }
Esempio n. 2
0
        private DataGridViewModel <AppPushRecordInfo> GetDataList(AppPushRecordQuery query)
        {
            DataGridViewModel <AppPushRecordInfo> dataGridViewModel = new DataGridViewModel <AppPushRecordInfo>();

            if (query != null)
            {
                PageModel <AppPushRecordInfo> appPushRecords = VShopHelper.GetAppPushRecords(query);
                dataGridViewModel.rows = (from c in appPushRecords.Models
                                          select new AppPushRecordInfo
                {
                    PushRecordId = c.PushRecordId,
                    PushTypeText = ((Enum)(object)(EnumPushType)c.PushType).ToDescription(),
                    PushTag = c.PushTag,
                    PushTagText = c.PushTagText,
                    PushSendDate = c.PushSendDate,
                    PushStatusText = ((Enum)(object)(EnumPushStatus)c.PushStatus).ToDescription(),
                    PushTitle = c.PushTitle,
                    PushRemark = c.PushRemark,
                    PushStatus = c.PushStatus,
                    UserId = c.UserId
                }).ToList();
                dataGridViewModel.total = appPushRecords.Total;
                foreach (AppPushRecordInfo row in dataGridViewModel.rows)
                {
                }
            }
            return(dataGridViewModel);
        }
Esempio n. 3
0
        public PageModel <AppPushRecordInfo> GetAppPushRecords(AppPushRecordQuery query)
        {
            StringBuilder stringBuilder = new StringBuilder("1=1");

            if (query.StartDate.HasValue)
            {
                stringBuilder.AppendFormat(" AND PushSendDate>='{0}'", query.StartDate.Value);
            }
            if (query.EndDate.HasValue)
            {
                stringBuilder.AppendFormat(" AND PushSendDate<='{0}'", query.EndDate.Value.ToString("yyyy-MM-dd") + " 23:59:59");
            }
            if (query.PushStatus.HasValue)
            {
                stringBuilder.AppendFormat(" AND PushStatus={0}", (int)query.PushStatus.Value);
            }
            if (query.PushType.HasValue)
            {
                stringBuilder.AppendFormat(" AND PushType={0}", (int)query.PushType.Value);
            }
            return(DataHelper.PagingByRownumber <AppPushRecordInfo>(query.PageIndex, query.PageSize, "PushRecordId", query.SortOrder, true, "Hishop_AppPushRecords", "PushRecordId", stringBuilder.ToString(), "*"));
        }