public void ImplicitConversionToStringResultsInCorrectString() { const string value = "SSW\\Nemanja"; var account = AddAccount.For(value); string result = account; Assert.AreEqual(value, result); }
public AddAccount GetDto(Applicant applicant) { var account = new AddAccount() { Message = GetMessage(applicant) }; return(account); }
private void button1_Click(object sender, EventArgs e) { //Add an account AccountOperation addMAccount = new AddAccount(); addMAccount.SetDataTable(originalTable); addMAccount.ShowDialog(); FillTheDatagrid(); }
public void Bank_Add() { if (selectedBank.BANK_ID != null && selectedBank.BANK_ID != 0) { App.Current.Properties["BankId"] = selectedBank.BANK_ID; AddAccount _BankAccountList = new AddAccount(); _BankAccountList.Show(); } else { MessageBox.Show("Please Select A Bank To Add Account..", "Item Selection", MessageBoxButton.OK, MessageBoxImage.Error); } }
public BaseResult AddAccount(Applicant applicant) { var result = new BaseResult(); using (var tr = new Tracer("LMS.Connector.CCM.Behaviors.Soap.AddAccountBehavior.AddAccount")) { tr.Log($"AddAccount for ApplicantId {applicant.ApplicantId}, PersonNumber => {applicant.PersonNumber}"); tr.Log($"AddAccount _account null? => {_account == null}"); if (_account == null) { tr.Log("Call GetDto() to get new _account"); _account = GetDto(applicant); } tr.LogObject(_account); try { tr.Log("Calling ISoapRepository.AddAccount"); _messageResponse = _soapRepository.AddAccount(_account, _app, applicant); tr.Log($"_messageResponse.AccountNumber = {_messageResponse?.AccountNumber}"); tr.Log($"_messageResponse.ResponseCode = {_messageResponse?.ResponseCode}"); tr.Log($"_messageResponse.ErrorMessage = {_messageResponse?.ErrorMessage}"); } catch (Exception ex) { tr.LogException(ex); result.Result = false; result.ExceptionId = Utility.LogError(ex, "LMS.Connector.CCM.Behaviors.Soap.AddAccountBehavior.AddAccount"); result.AddMessage(MessageType.Error, $"Exception when attempting to call SOAP Repository AddAcount(): {ex.Message}"); } finally { // Deallocate DTO _account = null; } if (_messageResponse?.ResponseCode != "Success" && _messageResponse?.ErrorMessage?.Length > 0) { result.Result = false; result.AddMessage(MessageType.Error, _messageResponse.ErrorMessage); } } return(result); }
public async Task AddAccountAsync(AddAccount command) { var user = await userRepository.GetFirstUserAsync(); var account = Account.Create(command.Name, command.CurrencyId, command.AccountGroupId, command.IsIncludedInTotal, command.Comment, command.Order, command.Type, command.ParentAccountId, true, user.Id, command.ExternalId.ToString()); await accountRepository.AddAccountAsync(account); if (account.Id <= 0) { throw new Exception(); } if (account.Type != AccountType.Card) { await this.accountRepository.BalanceAdjustmentAsync(account.Id, command.Amount); } }
public MessageResponse AddAccount(AddAccount account, Application app, Applicant applicant) { MessageResponse messageResponse = null; string messageXml = string.Empty; using (var tr = new Tracer("LMS.Connector.CCM.Repositories.SoapRepository.AddAccount")) { try { messageXml = account.Message?.SerializeToXmlString(); tr.Log($"AddAccount: BEFORE setting host values => {messageXml}"); tr.Log("AddAccount: Set Application-level host values "); messageXml = HostValueTranslator.UpdateRequestWithHostValues( messageXml, app.HostValues.Where(hv => hv.Field1.StartsWith("AddAccount.")).ToList(), account.Message?.HostValueParentNode ); tr.Log($"AddAccount: AFTER Application-level host values => {messageXml}"); tr.Log("AddAccount: Set Applicant-level host values"); messageXml = HostValueTranslator.UpdateRequestWithHostValues( messageXml, applicant.HostValues.Where(hv => hv.Field1.StartsWith("AddAccount.")).ToList(), account.Message?.HostValueParentNode ); tr.Log($"AddAccount: AFTER Applicant-level host values => {messageXml}"); tr.LogObject(CredentialsHeader); tr.Log("AddAccount: Calling ISoapRepository.ProcessMessage"); messageResponse = ProcessMessage(messageXml); } catch (Exception ex) { // Handle serialization and host value translation exceptions here tr.LogException(ex); Utility.LogError(ex, "LMS.Connector.CCM.Repositories.SoapRepository.AddAccount"); throw; } } return(messageResponse); }
public async Task <AccountResponse> AddAccountAsync(AddAccount account) { AccountEntity accountEntity = JsonConvert.DeserializeObject <AccountEntity>(JsonConvert.SerializeObject(account)); var resp = await _accountRepo.AddAccountAsync(accountEntity); if (resp == 1) { return new AccountResponse { RequestID = account.RequestID, StatusCode = "00", Message = "Successfully Added" } } ; else { throw new BadRequestException(new GeneralResponse { code = "400", message = "Failed To Add Account" }); } }
public AddAccount GetAddAccountOrganizationDto() { var account = new AddAccount() { Message = new Dto.Soap.Message() { DataUpdate = new DataUpdate() { TraceNumber = "33333333", ProcessingCode = "ExternalUpdateRequest", Source = "LoanOrigination", UpdateAction = "Add", Account = new Account() { LoanOfficerName = "Steve Higgs", AccountOpenDate = "2019-05-20", //ProductName = "Test Gold", RateClass = "Promo Test Gold", CreditLimit = 20000.00m, TaxOwnerPartyId = "5597", TaxOwnerPartyType = "Person", UserFields = new List <UserField>() { new UserField() { Name = "LoanOfficerType", Value = "HomeOffice" }, new UserField() { Name = "OriginationMethod", Value = "IASystems" } } } } } }; return(account); }
private void gridData_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //return; try { Poker pokerUpdate = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as Poker; Dictionary <string, object> dicParam = new Dictionary <string, object>(); AddAccount addAccount = new AddAccount(); addAccount.Account = pokerUpdate.RowData[M_AccountConst.Account].ToString(); //addAccount.Password = pokerUpdate.RowData[M_AccountConst.Password].ToString(); addAccount.ShowDialog(); dicParam = addAccount.DicParams; if (dicParam != null && dicParam.ContainsKey(M_AccountConst.Account) && dicParam.ContainsKey(M_AccountConst.Password) && dicParam.ContainsKey(M_AccountConst.CookieFB) && dicParam.ContainsKey(M_AccountConst.FaceBookID)) { DataTable dtAccount = dbProvider.GetData("SELECT * FROM " + M_AccountConst.TableName + " WHERE Pid = '" + pokerUpdate.RowData[M_AccountConst.Pid].ToString() + "'", M_AccountConst.TableName); if (dtAccount != null && dtAccount.Rows.Count > 0) { DataRow rowAccount = dtAccount.Rows[0]; rowAccount[M_AccountConst.Account] = dicParam[M_AccountConst.Account]; rowAccount[M_AccountConst.CookieFB] = dicParam[M_AccountConst.CookieFB]; rowAccount[M_AccountConst.FaceBookID] = dicParam[M_AccountConst.FaceBookID]; rowAccount[M_AccountConst.PackageXid] = pokerUpdate.RowData[M_AccountConst.PackageXid]; rowAccount[M_AccountConst.Password] = dicParam[M_AccountConst.Password]; if (dbProvider.Execute(dtAccount)) { dicPoker.Remove((Int64)pokerUpdate.RowData[M_AccountConst.Pid]); getAccountOfPack(txtPackNo.Text.Trim()); } } } } catch (Exception ex) { } }
public AddAccount GetAddAccountDto(Application app, Applicant applicant, string userToken) { var stubServiceRepo = Substitute.For <ISoapRepository>(); var stubLmsRepo = Substitute.For <ILmsRepository>(); var fakeBehavior = new AddAccountBehavior(app, userToken, stubServiceRepo, stubLmsRepo); var account = new AddAccount() { Message = new Dto.Soap.Message() { DataUpdate = new DataUpdate() { TraceNumber = "668254", ProcessingCode = "ExternalUpdateRequest", Source = "LoanOrigination", UpdateAction = "Add", UpdateTarget = "Account", Account = new Account() { LoanOfficerName = "Admin Admin", AccountOpenDate = "2019-07-25", ProductName = app.HostValues.Any(h => h.Field1.Equals("AddAccount.Message.DataUpdate.Account.ProductName")) ? string.Empty : null, RateClass = app.HostValues.Any(h => h.Field1.Equals("AddAccount.Message.DataUpdate.Account.RateClass")) ? string.Empty : null, PromotionalRateClass = app.HostValues.Any(h => h.Field1.Equals("AddAccount.Message.DataUpdate.Account.PromotionalRateClass")) ? string.Empty : null, PromotionalRateClassStartDate = app.HostValues.Any(h => h.Field1.Equals("AddAccount.Message.DataUpdate.Account.PromotionalRateClassStartDate")) ? string.Empty : null, PromotionalRateClassEndDate = app.HostValues.Any(h => h.Field1.Equals("AddAccount.Message.DataUpdate.Account.PromotionalRateClassEndDate")) ? string.Empty : null, CreditLimit = 10000.00m, TaxOwnerPartyId = "79396", TaxOwnerPartyType = "Person", UserFields = fakeBehavior.GetUserFields(applicant) } } } }; return(account); }
public async Task SeedAsync() { var accountGroup = (await this.accountGroupService.GetAccountGroupsAsync()).First(); var currencies = await this.currencyService.GetCurriencesAsync(); var addAccountCommand = new AddAccount { AccountGroupId = accountGroup.Id, Amount = 0, CurrencyId = currencies.First().Id, IsIncludedInTotal = true, Name = "Test Account", Order = 0, Type = AccountType.Account }; await commandDispatcher.DispatchAsync(addAccountCommand); var account = (await accountService.GetAccountsWithBalanceAsync()).First(); var categories = await categoryService.GetCategoriesAsync(); Random random = new Random(); for (int i = 0; i < 5; i++) { var amount = random.Next(-20, 20); var addTransactionCommand = new AddTransaction { AccountId = account.Id, Amount = amount, Date = DateTime.UtcNow, Type = amount < 0 ? ExtendedTransactionType.Expense : ExtendedTransactionType.Income, CategoryId = categories.First().Id, Name = Guid.NewGuid().ToString() }; await commandDispatcher.DispatchAsync(addTransactionCommand); } }
public BankAccount(AddAccount command) { Name = command.Name; Balance = command.OpeningBalance; }
public void SetUp() { _account = GetAddAccountDto(); _app = GetApplication(); _userToken = "aBc123"; }
public void OnAddAccount(DateTime time, IEnumerable <AccountInfo> accounts) { Task.Run(() => AddAccount?.Invoke(this, new Tuple <DateTime, IEnumerable <AccountInfo> >(time, accounts))); }
public AddAccountPresenter(AddAccount view) { this.view = view; }
public void TearDown() { _account = null; _app = null; }
public async Task <AccountResponse> Add(AddAccount account) => await _account.AddAccountAsync(account);
public override Task <Unit> Handle(AddAccount request, CancellationToken cancellationToken) { return(Unit.Task); }
public async Task <ActionResult> Add(AddAccount command) { await _commandProcessor.ProcessAsync(command); return(RedirectToAction("Index")); }
public AddAccountResponseData addAccount(AddAccountPayload addAccountPayload) { AddAccount addAccount = new AddAccount(); return(addAccount.addBankAccount(addAccountPayload, NewCredentials)); }