コード例 #1
0
        public static void UpdateOpenId(string phone, string openId)
        {
            IMobileTokenService mobileTokenService = BLLContainer.Resolve <IMobileTokenService>();
            var model = mobileTokenService.GetModels(p => p.Phone.Equals(phone)).FirstOrDefault <t_MobileToken>();

            if (model != null)
            {
                model.OpenId = openId;
                mobileTokenService.Update(model);
            }
        }
コード例 #2
0
        public static bool UpdateAliBuyerId(string phone, string buyerId)
        {
            IMobileTokenService mobileTokenService = BLLContainer.Resolve <IMobileTokenService>();
            var model = mobileTokenService.GetModels(p => p.Phone.Equals(phone)).FirstOrDefault <t_MobileToken>();

            if (model != null)
            {
                model.AliId = buyerId;
                return(mobileTokenService.Update(model));
            }
            return(false);
        }
コード例 #3
0
        private static void SetDBMobileToken(string Token, string Phone)
        {
            IMobileTokenService mobileTokenService = BLLContainer.Resolve <IMobileTokenService>();
            var           model = mobileTokenService.GetModels(p => p.Phone.Equals(Phone)).FirstOrDefault <t_MobileToken>();
            t_MobileToken mtk   = new t_MobileToken();

            if (model == null)
            {
                mtk.Token      = Token;
                mtk.CreateTime = DateTime.Now;
                mtk.Phone      = Phone;
                mtk.OpenId     = string.Empty;
                mobileTokenService.Add(mtk);
            }
            else
            {
                model.Token      = Token;
                model.UpdateTime = DateTime.Now;
                mobileTokenService.Update(model);
            }
        }