public DTOAccount GetAccountById(int idaccount) { string query = string.Format("SELECT idaccount,nameaccount,password,status,idstaff FROM TableAccount WHERE idaccount={0}", idaccount); DataTable dt = DataProvider.Instance.ExecuteQuery(query); DTOAccount gv = new DTOAccount(dt.Rows[0]); return(gv); }
public static DbAccount UpdateDbAccount(DTOAccount dtoAccount, DbAccount account, DbHolder holder) { account.AccountType = dtoAccount.AccountType; account.Balance = dtoAccount.Balance; account.Bonus = dtoAccount.Bonus; account.Holder = holder; account.IsEnabled = dtoAccount.IsEnabled; return(account); }
public List <DTOAccount> GetListAccount() { List <DTOAccount> list = new List <DTOAccount>(); string query = string.Format("SELECT * FROM TableAccount "); DataTable dt = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow item in dt.Rows) { DTOAccount account = new DTOAccount(item); list.Add(account); } return(list); }
public static Account ToORMAccount(this DTOAccount dtoAccount) { var account = new Account { Id = dtoAccount.Id, Account_number = dtoAccount.Number, AccountType = dtoAccount.AccountType.ToString(), Amount = dtoAccount.Amount, Person = dtoAccount.Person.ToORMPerson(), IsClosed = dtoAccount.IsClosed }; return(account); }
public static Account ToAccount(this DTOAccount dtoAccount) { var account = new Account { Id = dtoAccount.Id, Balance = dtoAccount.Balance, Holder = dtoAccount.Holder.ToHolder(), AccountType = dtoAccount.AccountType.ToAccountType(), Bonus = dtoAccount.Bonus.ToBonus(), IsEnabled = dtoAccount.IsEnabled }; account.OnTransaction += account.AccountType.AccountEvent; return(account); }
public static DTOAccount ToDTOAccount(this Account account) { var dtoAccount = new DTOAccount { Id = account.Id, Number = account.Account_number, ///////ATTENTION//////////////// AccountType = BLL.Interface.Entities.AccountType.Base, /////////////////////////////// Amount = account.Amount, Person = account.Person.ToDTOPerson(), IsClosed = account.IsClosed }; return(dtoAccount); }
public static Account ConvertToAccount(this DTOAccount dtoAccount) { switch (dtoAccount.AccountType) { case (int)AccountType.Base: return(new BaseAccount(dtoAccount.Id, dtoAccount.Name, dtoAccount.Balance, dtoAccount.Bonus)); case (int)AccountType.Silver: return(new BaseAccount(dtoAccount.Id, dtoAccount.Name, dtoAccount.Balance, dtoAccount.Bonus)); case (int)AccountType.Gold: return(new BaseAccount(dtoAccount.Id, dtoAccount.Name, dtoAccount.Balance, dtoAccount.Bonus)); case (int)AccountType.Platinum: return(new BaseAccount(dtoAccount.Id, dtoAccount.Name, dtoAccount.Balance, dtoAccount.Bonus)); default: throw new ArgumentOutOfRangeException(); } }
public static Account ToBLLAccount(this DTOAccount dtoAccount) { return(AccountFactory.Create(dtoAccount.AccountType, dtoAccount.Person.ToBllPerson(), dtoAccount.Number, dtoAccount.Amount, dtoAccount.IsClosed)); }