Exemple #1
0
        /// <summary>
        /// 专业版发送订单消息到商家版小程序
        /// </summary>
        /// <param name="msgDic"></param>
        /// <param name="aId"></param>
        /// <param name="id"></param>
        internal bool SendOrderMessage(Dictionary <string, object> msgDic, int aid, int orderId)
        {
            bool result = false;

            if (msgDic.Count <= 0 || orderId <= 0 || aid <= 0)
            {
                return(result);
            }
            XcxAppAccountRelation xcxAppAccountRelation = XcxAppAccountRelationBLL.SingleModel.GetModel(aid);

            if (xcxAppAccountRelation == null)
            {
                return(result);
            }
            SystemUpdateMessage message = new SystemUpdateMessage()
            {
                Title     = orderId.ToString(),
                AccountId = xcxAppAccountRelation.AccountId.ToString(),
                aid       = aid,
                Content   = JsonConvert.SerializeObject(msgDic),
                Type      = 4,
                AddTime   = DateTime.Now
            };

            message.Id = Convert.ToInt32(SingleModel.Add(message));
            if (message.Id <= 0)
            {
                return(result);
            }
            SystemUpdateUserLog log = new SystemUpdateUserLog()
            {
                AccountId       = xcxAppAccountRelation.AccountId.ToString(),
                UpdateMessageId = message.Id
            };

            result = Convert.ToInt32(SystemUpdateUserLogBLL.SingleModel.Add(log)) > 0;
            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 专业版发送预约信息通知到商家小程序
        /// </summary>
        /// <param name="id"></param>
        /// <param name="aid"></param>
        /// <returns></returns>
        public bool SendSubscribeMessage(int formId, int aid, string content)
        {
            bool result = false;

            if (formId <= 0 || string.IsNullOrEmpty(content) || aid <= 0)
            {
                return(result);
            }
            XcxAppAccountRelation xcxAppAccountRelation = XcxAppAccountRelationBLL.SingleModel.GetModel(aid);

            if (xcxAppAccountRelation == null)
            {
                return(result);
            }
            SystemUpdateMessage message = new SystemUpdateMessage()
            {
                Title     = formId.ToString(),
                AccountId = xcxAppAccountRelation.AccountId.ToString(),
                aid       = aid,
                Content   = content,
                Type      = 3,
                AddTime   = DateTime.Now
            };

            message.Id = Convert.ToInt32(SingleModel.Add(message));
            if (message.Id <= 0)
            {
                return(result);
            }
            SystemUpdateUserLog log = new SystemUpdateUserLog()
            {
                AccountId       = xcxAppAccountRelation.AccountId.ToString(),
                UpdateMessageId = message.Id
            };

            result = Convert.ToInt32(SystemUpdateUserLogBLL.SingleModel.Add(log)) > 0;
            return(result);
        }