Beispiel #1
0
        /// <summary>
        /// 获取所有群发消息
        /// </summary>
        public List <T> GetAllGsMessage <T>()
        {
            List <T> pList = new List <T>();

            this.ExecuteTryCatch(() =>
            {
                WXGsMessageDA pDa = new WXGsMessageDA();
                //获取从服务器当天时间算起,的两个月时间内的群发消息,例如:当天为10月,即是获得9、10月的消息记录
                string strDateFilter = GetTargetDateFilter(WXGsMessageDA.FIELD_NAME_MTIME, 1);
                DataTable dt         = pDa.GetGsMessage(strDateFilter, m_sdk.WXType);
                if (dt == null || dt.Rows.Count == 0)
                {
                    EGExceptionOperator.ThrowX <Exception>("缺少群发消息数据", EGActionCode.缺少目标数据);
                }

                pList = CommonFunction.GetEntitiesFromDataTable <T>(dt);
            });
            return(pList);
        }
Beispiel #2
0
        /// <summary>
        /// 获取所有群发消息
        /// </summary>
        public List <T> GetGsMessage <T>(string pFilter)
        {
            List <T> pList = new List <T>();

            this.ExecuteTryCatch(() =>
            {
                WXGsMessageDA pDa = new WXGsMessageDA();
                //转换前端查询目标
                List <object> pQueryItems = CommonFunction.FromJsonTo <List <object> >(pFilter);
                //转换查询字典
                IDictionary <string, object> pDic = WXGsMessageDA.CreateDicItems(pQueryItems);
                //查询获取dATATABLE
                DataTable dt = pDa.GetGsMessage(pDic, m_sdk.WXType);
                if (dt == null || dt.Rows.Count == 0)
                {
                    EGExceptionOperator.ThrowX <Exception>("缺少群发消息数据", EGActionCode.缺少目标数据);
                }

                pList = CommonFunction.GetEntitiesFromDataTable <T>(dt);
            });
            return(pList);
        }