Beispiel #1
0
        /// <summary>
        /// 读取推送消息列表
        /// </summary>
        /// <param name="para">分页分页参数,并返回结果到对象</param>
        /// <returns></returns>
        /// <remarks>2014-01-14 邵斌 创建</remarks>
        public void GetApPushService(ref PagedList <CBApPushService> pageList, CBApPushService fileter)
        {
            Pager <CBApPushService> para = new Pager <CBApPushService>();

            para.CurrentPage = pageList.CurrentPageIndex;
            para.PageSize    = pageList.PageSize;
            para.PageFilter  = fileter;

            IAppContentDao.Instance.GetApPushService(ref para);

            pageList.TData          = para.Rows;
            pageList.TotalItemCount = para.TotalRows;
        }
Beispiel #2
0
        public ActionResult AppPushServiceManage(ParaApPushServiceSearchFilter filter)
        {
            filter.id = (filter.id == 0 ? 1 : filter.id);
            var             page = new PagedList <CBApPushService>();
            CBApPushService para = filter == null ? new CBApPushService() : (CBApPushService)filter;

            page.CurrentPageIndex = filter.id;

            //格式化数据
            filter.Title           = (filter.Title ?? "").Trim();
            filter.Content         = (filter.Content ?? "").Trim();
            filter.CustomerAccount = (filter.CustomerAccount ?? "").Trim();

            AppContentBo.Instance.GetApPushService(ref page, para);
            return(View("_AppPushServiceManage_Pager", page));
        }
Beispiel #3
0
        /// <summary>
        /// 更新推送消息对象
        /// </summary>
        /// <param name="model">消息对象</param>
        /// <returns>返回 true:更新成功 false:更新失败</returns>
        /// <remarks>2014-01-14 邵斌 创建</remarks>
        public bool UpdateApPushService(CBApPushService model)
        {
            var result = IAppContentDao.Instance.UpdateApPushService(model);

            if (result)
            {
                //写日志
                BLL.Log.SysLog.Instance.Info(LogStatus.系统日志来源.后台, string.Format("修改推送消息{0}", model.SysNo),
                                             LogStatus.系统日志目标类型.推送信息,
                                             model.SysNo, AdminAuthenticationBo.Instance.Current.Base.SysNo);
            }
            else
            {
                //写错误日志
                BLL.Log.SysLog.Instance.Error(LogStatus.系统日志来源.后台, string.Format("修改推送消息{0}失败", model.SysNo),
                                              LogStatus.系统日志目标类型.推送信息,
                                              model.SysNo, AdminAuthenticationBo.Instance.Current.Base.SysNo);
            }

            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// 更新推送消息对象
        /// </summary>
        /// <param name="model">消息对象</param>
        /// <returns>返回 true:更新成功 false:更新失败</returns>
        /// <remarks>2014-01-14 邵斌 创建</remarks>
        public override bool UpdateApPushService(CBApPushService model)
        {
            //如果是给给人推送消息,将检查个人账号是否设置正确
            if (model.ServiceType == (int)AppStatus.App推送服务类型.个人消息 && !string.IsNullOrEmpty(model.CustomerAccount))
            {
                //获取个人信息
                var user = Hyt.DataAccess.CRM.ICrCustomerDao.Instance.GetCrCustomer(model.CustomerAccount);
                if (user == null)
                {
                    return(false);
                }

                model.CustomerSysNo = user.SysNo;
            }
            else if (model.ServiceType == (int)AppStatus.App推送服务类型.App浏览器 && !string.IsNullOrEmpty(model.Url))
            {
                model.Parameter = model.Url;
            }

            return(Context.Update("ApPushService", (ApPushService)model)
                   .AutoMap(m => m.SysNo)
                   .Where("SysNo", model.SysNo)
                   .Execute() > 0);
        }
Beispiel #5
0
        /// <summary>
        /// 创建推送消息对象
        /// </summary>
        /// <param name="model">消息对象</param>
        /// <returns>返回 true:成功 false:失败</returns>
        /// <remarks>2014-01-14 邵斌 创建</remarks>
        public override bool CreateApPushService(CBApPushService model)
        {
            bool result = false;

            using (var _context = Context.UseSharedConnection(true))
            {
                //如果是给给人推送消息,将检查个人账号是否设置正确
                if (model.ServiceType == (int)AppStatus.App推送服务类型.个人消息 && !string.IsNullOrEmpty(model.CustomerAccount))
                {
                    //获取个人信息
                    var user = Hyt.DataAccess.CRM.ICrCustomerDao.Instance.GetCrCustomer(model.CustomerAccount);
                    if (user == null)
                    {
                        return(false);
                    }

                    model.CustomerSysNo = user.SysNo;
                }
                else if (model.ServiceType == (int)AppStatus.App推送服务类型.App浏览器 && !string.IsNullOrEmpty(model.Url))
                {
                    model.Parameter = model.Url;
                }
                if (model.BeginTime == DateTime.MinValue)
                {
                    model.BeginTime = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
                }
                if (model.EndTime == DateTime.MinValue)
                {
                    model.EndTime = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
                }
                model.SysNo = _context.Insert("ApPushService", model as ApPushService).AutoMap(m => m.SysNo).ExecuteReturnLastId <int>("SysNo");
                result      = model.SysNo > 0;
            }

            return(result);
        }
Beispiel #6
0
 /// <summary>
 /// 更新推送消息对象
 /// </summary>
 /// <param name="model">消息对象</param>
 /// <returns>返回 true:更新成功 false:更新失败</returns>
 /// <remarks>2014-01-14 邵斌 创建</remarks>
 public abstract bool UpdateApPushService(CBApPushService model);