示例#1
0
        public string ReplaceTemplate(string message, EventVipEntity eventVip, VipEntity vip, LEventsEntity eventEntity)
        {
            message = message.Replace("$VipName$", eventVip.VipName);
            message = message.Replace("$Region$", eventVip.Seat);
            message = message.Replace("$Seat$", eventVip.Seat);
            message = message.Replace("$Ver$", new Random().Next().ToString());
            message = message.Replace("$CustomerId$", eventVip.CustomerId);
            message = message.Replace("$UserId$", vip.VIPID);
            message = message.Replace("$OpenId$", vip.WeiXinUserId);
            message = message.Replace("$EventName$", eventEntity.Title);

            return(message);
        }
示例#2
0
        /// <summary>
        /// GetList
        /// </summary>
        /// <param name="entity">entity</param>
        /// <param name="Page">分页页码。从0开始</param>
        /// <param name="PageSize">每页的数量。未指定时默认为15</param>
        /// <returns></returns>
        public IList <EventVipEntity> GetList(EventVipEntity entity, int Page, int PageSize)
        {
            if (PageSize <= 0)
            {
                PageSize = 15;
            }

            IList <EventVipEntity> list = new List <EventVipEntity>();
            DataSet ds = new DataSet();

            ds = _currentDAO.GetList(entity, Page, PageSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                list = DataTableToObject.ConvertToList <EventVipEntity>(ds.Tables[0]);
            }
            return(list);
        }
示例#3
0
 public void Update(EventVipEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
示例#4
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(EventVipEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
示例#5
0
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(EventVipEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
示例#6
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(EventVipEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
示例#7
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <EventVipEntity> PagedQueryByEntity(EventVipEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
示例#8
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public EventVipEntity[] QueryByEntity(EventVipEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
示例#9
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Delete(EventVipEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Delete(pEntity, pTran);
 }
示例#10
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(EventVipEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
示例#11
0
 public void Update(EventVipEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
示例#12
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(EventVipEntity pEntity)
 {
     Update(pEntity, true);
 }
示例#13
0
        /// <summary>
        /// 发送微信消息
        /// </summary>
        /// <param name="VipId">用户标识</param>
        /// <param name="EventId">活动标识</param>
        /// <param name="strError">错误提示</param>
        /// <returns></returns>
        public bool SetEventVipSeatPush(string VipId, string EventId, out string strError)
        {
            strError = "成功.";
            #region //1.判断用户是否关注过活动
            WEventUserMappingBLL eventServer = new WEventUserMappingBLL(this.CurrentUserInfo);
            var eventList = eventServer.QueryByEntity(new WEventUserMappingEntity
            {
                UserID = VipId
                ,
                IsDelete = 0
                ,
                EventID = EventId
            }, null);
            if (eventList == null || eventList.Length == 0)
            {
                #region
                WEventUserMappingEntity eventUserMappingInfo = new WEventUserMappingEntity();
                eventUserMappingInfo.Mapping = Common.Utils.NewGuid();
                eventUserMappingInfo.EventID = EventId;
                eventUserMappingInfo.UserID  = VipId;
                eventServer.Create(eventUserMappingInfo);
                #endregion
            }
            #endregion

            #region //2.判断用户是否注册
            VipBLL    vipServer = new VipBLL(this.CurrentUserInfo);
            VipEntity vipInfo   = new VipEntity();
            vipInfo = vipServer.GetByID(VipId);
            if (vipInfo == null || vipInfo.VIPID.Equals(""))
            {
                strError = "用户不存在";
                return(false);
            }
            #endregion
            else
            {
                #region
                EventVipEntity eventVipInfo = new EventVipEntity();
                var            eventVipList = _currentDAO.QueryByEntity(new EventVipEntity
                {
                    Phone = vipInfo.Phone
                    ,
                    IsDelete = 0
                }, null);
                if (eventVipList == null || eventVipList.Length == 0)
                {
                    strError = "没有合适的员工.";
                    return(false);
                }
                else
                {
                    eventVipInfo = eventVipList[0];
                }
                #endregion

                LEventsEntity lEventsEntity = new LEventsEntity();
                lEventsEntity = new LEventsBLL(this.CurrentUserInfo).GetByID(EventId);

                //string message = "尊贵的" + eventVipInfo.VipName + "先生/女士:\r\n 诚挚地欢迎您参加复星集团2014年全球工作会议,本次会议将于8:30正式开始。请您至5楼静安大宴会厅" + eventVipInfo.Seat + "区域就坐,或参见胸卡背面提示.";

                string message = new WMaterialWritingBLL(this.CurrentUserInfo).GetWMaterialWritingByModelId(EventId).Content;
                message = ReplaceTemplate(message, eventVipList[0], vipInfo, lEventsEntity);

                //组织消息
                string code = JIT.CPOS.BS.BLL.WX.CommonBLL.SendWeixinMessage(message, VipId, this.CurrentUserInfo, vipInfo);
                switch (code)
                {
                case "103":
                    strError = "未查询到匹配的公众账号信息";
                    break;

                case "203":
                    strError = "发送失败";
                    break;

                default:
                    break;
                }
            }
            return(true);
        }
示例#14
0
 /// <summary>
 /// GetListCount
 /// </summary>
 /// <param name="entity">entity</param>
 public int GetListCount(EventVipEntity entity)
 {
     return(_currentDAO.GetListCount(entity));
 }