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); } }
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); }
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); } }