Exemplo n.º 1
0
        /// <summary>
        /// Update account data
        /// </summary>
        /// <param name="account">Account data</param>
        public void UpdateAccount(CommonData.Account account)
        {
            Account db_account = new Account()
            {
                AccountID     = account.AccountID,
                Code          = account.Code,
                Name          = account.Name,
                CommPerc      = account.CommPerc,
                IsShortEnable = account.IsShortEnable,
                AccountType   = (byte)account.AccountType
            };

            _da.DbContext.Update(db_account);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Insert new account into db
        /// </summary>
        /// <param name="account">Account (Id = 0)</param>
        /// <returns>New Id (also set new Id in account data)</returns>
        public int InsertAccount(CommonData.Account account)
        {
            Account db_account = new Account()
            {
                AccountID     = account.AccountID,
                Code          = account.Code,
                Name          = account.Name,
                CommPerc      = account.CommPerc,
                IsShortEnable = account.IsShortEnable,
                AccountType   = (byte)account.AccountType
            };

            _da.DbContext.Insert(db_account);
            account.AccountID = db_account.AccountID;

            return(account.AccountID);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get all accounts
        /// </summary>
        /// <returns>Accounts list</returns>
        public IEnumerable <CommonData.Account> GetAccounts()
        {
            List <CommonData.Account> accounts = new List <CommonData.Account>();

            var db_accounts = _da.DbContext.Table <Account>().ToList();

            foreach (var db_account in db_accounts)
            {
                var account = new CommonData.Account()
                {
                    AccountID     = db_account.AccountID,
                    Code          = db_account.Code,
                    Name          = db_account.Name,
                    CommPerc      = db_account.CommPerc,
                    IsShortEnable = db_account.IsShortEnable,
                    AccountType   = (CommonData.AccountTypes)db_account.AccountType
                };
                accounts.Add(account);
            }

            return(accounts);
        }
Exemplo n.º 4
0
		private void _VerifyDone(Account obj)
		{
			_OnVerifySuccessEvent?.Invoke(obj.Id);

			var room = _GameLobby.QueryRoom();

			room.OnToStartGameEvent += _OnToStartGame;

			room.Join(this);
		}
Exemplo n.º 5
0
 /// <summary>
 /// Обновить данные по счету
 /// </summary>
 /// <param name="account"></param>
 public void UpdateAccount(CommonData.Account account)
 {
     _accountDA.UpdateAccount(account);
 }