public void ModifyBalance(UserBalanceEntity balance) { persistence.Modify(balance); }
public void AddBalance(UserBalanceEntity balanceEntity) { persistence.Add(balanceEntity); }
public void Register(UserInfo user, string password) { LoginEntity loginEntity = new LoginEntity(); loginEntity.UserId = user.UserId; loginEntity.UserName = user.UserName; loginEntity.IsCanLogin = true; UserBaseEntity userBaseEntity = new UserBaseEntity(); userBaseEntity.UserId = user.UserId; userBaseEntity.RealName = user.RealName; userBaseEntity.Email = user.Email; userBaseEntity.CardType = user.IdCardType; userBaseEntity.CardNumber = user.IdCardNumber; userBaseEntity.Mobile = user.Mobile; UserBalanceEntity balanceEntity = new UserBalanceEntity(); balanceEntity.UserId = user.UserId; balanceEntity.Balance = 0; balanceEntity.Freeze = 0; try { using (ILHDBTran tran = BeginTran()) { UserManager manager = new UserManager(tran); password = EncryptTool.MD5(password); manager.AddLogin(loginEntity, password); manager.AddUserBase(userBaseEntity); manager.AddBalance(balanceEntity); tran.Commit(); } } catch (Exception ex) { string errMsg = "注册新用户失败 - 系统异常,请联系系统管理员!"; throw HandleException(LogCategory.Register, errMsg, ex); } }