示例#1
0
 public BankAccount8(string name, int number, double amount) : this(name, number)
 {
     balance = amount;
     if (balance >= 100)
     {
         accountState = AccountStateEnum.Active;
     }
 }
示例#2
0
 public void ChangeState(int id, AccountStateEnum state)
 {
     using (var session = Dao.SessionFactory.OpenSession())
     using (var tx = session.BeginTransaction())
     {
         var acc = session.Get<AccountEntity>(id).State.Identity = (int)state;
         session.Save(acc);
         tx.Commit();
     }
 }
示例#3
0
 public void ChangeState(int id, AccountStateEnum state)
 {
     using (var session = Dao.SessionFactory.OpenSession())
         using (var tx = session.BeginTransaction())
         {
             var acc = session.Get <AccountEntity>(id).State.Identity = (int)state;
             session.Save(acc);
             tx.Commit();
         }
 }
示例#4
0
 private void SetAccountState()
 {
     if (balance >= 100)
     {
         accountState = AccountStateEnum.Active;
     }
     else
     {
         accountState = AccountStateEnum.Inadequate;
     }
 }
示例#5
0
 public BankAccount8()
 {
     accountState = AccountStateEnum.Inadequate;
 }
 public AccountState(AccountStateEnum value)
 {
     Value = value;
 }