public override bool Execute() { if (!Verifier.CheckBankAccountNumber(BankAccountNumber)) { Information = StringSource.BankAccountNumberStructureError(); return(false); } using (var bankService = new BLL.ServiceReference1.BankServiceClient()) { BankAccount = bankService.GetBankAccountByNumber(BankAccountNumber); if (BankAccount == null) { Information = StringSource.BankAccountNotFound(); return(false); } Currency = bankService.GetCurrencyById(BankAccount.CurrencyID); } if (Currency == null) { Information = StringSource.CurrencyNotFound(); return(false); } IdBankAccount = BankAccount.BankAccountID; Balance = BankAccount.Balance.ToString(); CurrencyName = Currency.Name; CurrencyShortName = Currency.ShortName; IdCurrency = Currency.CurrencyID; Information = StringSource.BankAccountAndClientInfo(BankAccount, Customer, Currency); return(true); }
public override bool Execute() { if (IdCardAccount <= 0) { Information = StringSource.CardAccountNotFound(); return(false); } using (var bankService = new BLL.ServiceReference1.BankServiceClient()) { CardAccount = bankService.GetCardAccountById(IdCardAccount); if (CardAccount == null) { Information = StringSource.CardAccountNotFound(); return(false); } CardAccount.IsLocked = CardAccount.IsLocked == true ? false : true; CardAccount.Status = CardAccount.IsLocked == true ? DataSource.CardStatusLocked : DataSource.CardStatusUnLocked; bankService.UpdateCardAccount(CardAccount); BankAccount = bankService.GetBankAccountById(CardAccount.BankAccountID); if (BankAccount != null) { Currency = bankService.GetCurrencyById(BankAccount.CurrencyID); } } Information = CardAccount.IsLocked == true?StringSource.CardAccountLocked() : StringSource.CardAccountUnlocked(); Information += "\n" + StringSource.CardAccountInformation(CardAccount, BankAccount, Currency); return(true); }
public override bool Execute() { if (IdBankAccount <= 0) { Information = StringSource.BankAccountNotFound(); return(false); } using (var bankService = new BLL.ServiceReference1.BankServiceClient()) { BankAccount = bankService.GetBankAccountById(IdBankAccount); if (BankAccount == null) { Information = StringSource.BankAccountNotFound(); return(false); } Currency = bankService.GetCurrencyById(BankAccount.CurrencyID); } using (var local = new DAL.Repositories()){ Customer = local.Customers.GetSingle(BankAccount.CustomerID); } if (Currency == null) { Information = StringSource.CurrencyNotFound(); return(false); } IdBankAccount = BankAccount.BankAccountID; Information = StringSource.BankAccountAndClientInfo(BankAccount, Customer, Currency); return(true); }