public void Register(LoginQQ loginEntity, string userId) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var loginManager = new LoginQQManager()) { var tmp = loginManager.GetLoginByName(loginEntity.LoginName); if (tmp != null) { throw new AuthException("登录名已经存在 - " + loginEntity.LoginName); } loginEntity.User = loginManager.LoadUser(userId); loginEntity.Register = loginManager.LoadRegister(userId); loginManager.Register(loginEntity); } biz.CommitTran(); } }
/// <summary> /// 发送站内信 /// </summary> public void SendInnerMail(InnerMailInfo_Send innerMail, string createBy) { if (innerMail == null || string.IsNullOrEmpty(innerMail.Receivers)) { return; } var arrReceive = innerMail.Receivers.Split('|'); if (arrReceive.Length <= 0) { return; } using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { using (var manager = new InnerMailManager()) { biz.BeginTran(); foreach (var item in arrReceive) { if (string.IsNullOrEmpty(item)) { continue; } var mail = new SiteMessageInnerMailListNew { MailId = Guid.NewGuid().ToString(), SendTime = DateTime.Now, SenderId = createBy, HandleType = InnerMailHandleType.UnRead, MsgContent = innerMail.Content, ReceiverId = item, Title = innerMail.Title, }; manager.AddSiteMessageInnerMailListNew(mail); } biz.CommitTran(); } } }
public void Update(string userId, RegisterInfo_QQ qqInfo) { using (var biz = new GameBiz.Business.GameBizBusinessManagement()) { biz.BeginTran(); using (var loginManager = new LoginQQManager()) { var loginEntity = loginManager.GetLoginByUserId(userId); if (loginEntity == null) { throw new ArgumentException("此支付宝帐号不存在"); } loginEntity.LoginName = qqInfo.LoginName; loginEntity.DisplayName = qqInfo.DisplayName; loginEntity.OpenId = qqInfo.OpenId; loginManager.UpdateLogin(loginEntity); } biz.CommitTran(); } }