Esempio n. 1
0
        public static bool SetMemberCoinsMsgCacheData(SAppMessageType sAppMessageType, string orderId, string form_id, string mobile, object dataObj, out string errMsg)
        {
            string openId      = string.Empty;
            string accessToken = string.Empty;

            errMsg = string.Empty;
            try
            {
                if (MobileTokenBusiness.GetOpenId(mobile, out openId, out errMsg) && SAppTokenMana.GetAccessToken(out accessToken, out errMsg))
                {
                    SAppPushMessageCacheModel msgModel = new SAppPushMessageCacheModel(orderId, mobile, openId, form_id, CommonConfig.SAppMessagePushXmlFilePath, accessToken, sAppMessageType, dataObj);
                    SAppPushMessageBusiness.Add(msgModel);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
 public SAppPushMessageCacheModel(string orderId, string mobile, string openId, string formId, string xmlFilePath, string sAppAccessToken, SAppMessageType sAppMessageType, object dataObj)
 {
     this.OrderId         = orderId;
     this.Mobile          = mobile;
     this.OpenId          = openId;
     this.FormId          = formId;
     this.XmlFilePath     = xmlFilePath;
     this.SAppAccessToken = sAppAccessToken;
     this.DataObj         = dataObj;
     this.SAppMessageType = sAppMessageType;
     this.CreateTime      = System.DateTime.Now;
 }
Esempio n. 3
0
        public static bool SetMemberCoinsMsgCacheData(string orderId, string form_id, string mobile, SAppMessageType sAppMessageType, object dataObj, out string errMsg)
        {
            string openId      = string.Empty;
            string accessToken = string.Empty;

            errMsg = string.Empty;
            try
            {
                if (MobileTokenBusiness.GetOpenId(mobile, out openId, out errMsg) && SAppTokenMana.GetAccessToken(out accessToken, out errMsg))
                {
                    string xmlFilePath = HttpContext.Current.Server.MapPath("/Config/SAppMessageTemplate.xml");
                    SAppPushMessageCacheModel msgModel = new SAppPushMessageCacheModel(orderId, mobile, openId, form_id, xmlFilePath, accessToken, sAppMessageType, dataObj);
                    SAppPushMessageBusiness.Add(msgModel);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }