예제 #1
0
 public void ModifyBalance(UserBalanceEntity balance)
 {
     persistence.Modify(balance);
 }
예제 #2
0
 public void AddBalance(UserBalanceEntity balanceEntity)
 {
     persistence.Add(balanceEntity);
 }
예제 #3
0
 public void AddBalance(UserBalanceEntity balanceEntity)
 {
     persistence.Add(balanceEntity);
 }
예제 #4
0
 public void ModifyBalance(UserBalanceEntity balance)
 {
     persistence.Modify(balance);
 }
예제 #5
0
        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);
            }
        }