private void mainButtonClicked(object sender, EventArgs e) { if (sender.Equals(btnMaintenance)) { panelMain.Controls.Clear(); m = new MaintenanceForm(); m.Dock = DockStyle.Fill; panelMain.Controls.Add(m); } if (sender.Equals(btnReport)) { } if (sender.Equals(btnTransaction)) { panelMain.Controls.Clear(); t = new TransactionForm(); t.Dock = DockStyle.Fill; panelMain.Controls.Add(t); } if (sender.Equals(btnAbout)) { panelMain.Controls.Clear(); a = new AboutUs(); a.Dock = DockStyle.Fill; panelMain.Controls.Add(a); } }
public void GivenISelectTheFirstParticipantResult() { TransactionForm transactionForm = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); transactionForm.SelectFirstResultPayToTheOrderOfNotContaining("Add New Participant"); AddDataToScenarioContextOverridingExistentKey("Participant Description", transactionForm.GetTransactionName().Split('|')[0].TrimEnd()); }
private void transactionButton_Click(object sender, EventArgs e) { TransactionForm transactionForm = new TransactionForm(); transactionForm.Show(); transactionForm.Focus(); }
private void ThenISeeSUMOFALLOCATIONIsInABox(string sum, string boxColor) { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.SumOfAllocation.Should().Be(sum, "Sum Of Allocation values is correct"); newTransaction.SumOfAllocationBoxColor.Should().Be(boxColor, "Sum Of Allocation box COLOR correct"); }
private List <TransactionForm> GenerateTransactionForms(List <Transaction> Transactions, bool IsPlanned) { List <TransactionForm> transactionForms = new List <TransactionForm>(); TransactionForm transactionForm; if (Transactions == null) { return(transactionForms); } foreach (var transaction in Transactions) { transactionForm = new TransactionForm { Id = transaction.Id.ToString(), Name = transaction.Name, Description = transaction.Description, Amount = transaction.Amount, Date = transaction.Date, IsPlanned = IsPlanned, LinkedTransactionId = transaction.LinkedTransactionId }; transactionForms.Add(transactionForm); } return(transactionForms); }
private void WhenIClickOnSaveCheckForUTCSplit() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); string serialNbr = newTransaction.SerialNumber; //Save utc data on scenario context AddDataToScenarioContextOverridingExistentKey("Created Check UTC Splits Data", newTransaction.TransactionLinks.GetUTCSplitsData()); //Save newTransaction.Save(); try { //try to save created transaction id after (and IF) transaction for closes //Verify Trx form closes bankingTab.NewTransactionFormHasDissapeared().Should().BeTrue("Transaction Form Closes after Saving"); //Add crated trx data to context AddDataToScenarioContextOverridingExistentKey("Saved Transaction Id", bankingTab.GetTransactionIdFromListBySerialNumber(serialNbr)); } catch (Exception) { //do nothing, clicking on save doesn't mean the check saves } //Serial nmber of intent to save AddDataToScenarioContextOverridingExistentKey("Transaction Serial Number", serialNbr); }
private void GivenISeeSaveButtonsAreDisabledd() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.IsSaveButtonEnabled().Should().BeFalse("Save button is inactive"); newTransaction.IsSaveAndAddAnotherButtonEnabled().Should().BeFalse("Save And Add Another button is inactive"); }
public void ThenIEnterAmountFieldValue(string amount) { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.SetAmount(amount); newTransaction.PressTabKey(); }
public IActionResult AddTransaction(TransactionForm form) { if (ModelState.IsValid) { Account account = _context.Accounts.SingleOrDefault(a => a.Id == _currentUserId); List <Transaction> transactions = account.Transactions; string fileName = ""; if (form.Receipt != null) { fileName = Path.GetFileNameWithoutExtension(form.Receipt.FileName); string extension = Path.GetExtension(form.Receipt.FileName); fileName = Guid.NewGuid().ToString() + "_" + fileName + extension; string filePath = Path.Combine("wwwroot/images/", fileName); form.Receipt.CopyTo(new FileStream(filePath, FileMode.Create)); } Transaction newTransaction = new Transaction(form.TransactionType, form.Name, form.Amount ?? 0, form.Category, form.Note, fileName); account.Transactions.Add(newTransaction); _context.Accounts.Attach(account); var entry = _context.Entry(account); entry.Collection(a => a.Transactions).IsModified = true; _context.SaveChanges(); return(RedirectToAction("Dashboard")); } else { return(View()); } }
private void ThenISeeLabelsForUTCSplitColumnsAreCorrect() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.UTCSplitCodeLabel.Should().Be("CODE", "UTC Split Code label is correct"); newTransaction.UTCSplitNonCompensableLabel.Should().Be("NON-COMPENSABLE", "UTC Split Non Compensable label is correct"); newTransaction.CodeAmountLabel.Should().Be("CODE AMOUNT", "UTC Split Code Amount label is correct"); }
public static void RunTransactionForm(MainForm form, int userId) { form.Hide(); TransactionForm transactionForm = new TransactionForm(userId); transactionForm.Closed += (s, args) => form.Close(); transactionForm.Show(); }
public void ThenICanSelectAllDigitsFromAmountValueAndDeleteWithBACKSPACEKey() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); string original = newTransaction.Amount; newTransaction.DeleteAllDigitsFromAmount("backspace"); newTransaction.PressBackSpaceKey(); newTransaction.Amount.Should().Be("", "User can delete a value completely highlighting and pressing BACKSPACE key"); }
public async Task <IActionResult> Delete([FromForm] TransactionForm TransactionForm, string BudgetId, string CategoryId) { var modifiedBudget = await _transactionProcessor.DeleteTransaction(TransactionForm, BudgetId, CategoryId); if (modifiedBudget == null) { return(NotFound()); } return(Ok(modifiedBudget)); }
public void ThenICanSelectTwoDigitsFromAmountValueAndDeleteWithBACKSPACEKey(string expValue) { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); string original = newTransaction.Amount; newTransaction.DeleteFirstFourDigitsFromAmount("backspace"); newTransaction.PressBackSpaceKey(); newTransaction.PressTabKey(); newTransaction.Amount.Should().Be(expValue, "User can delete a value partially highlighting and pressing BACKSPACE key"); }
public void ThenISeeTheExactResultAsAnExistentPayToTheOrderOfValue(string text) { TransactionForm transactionForm = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); List <string> results = transactionForm.GetPayToTheOrderOfResultsByContent(text); for (int i = 1; i < results.Count; i++) //Discard first element, it is "Add New Participant Record" { results[i].Should().BeEquivalentTo(text, "Added participant appears as an existent participant on search results"); } }
private void ThenISeeCodeLayoutRestoresToInitialDisplay() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.UTCSplitRowsDissapeared().Should().BeTrue("UTC Split was removed"); newTransaction.IsSumOfAllocationFieldInvisible().Should().BeTrue(); newTransaction.NonCompensableLabel.Should().Be("Non-Compensable", "Non-Compensable label is restored to default"); newTransaction.CodeLabel.Should().Be("CODE", "CODE label is restored to default"); newTransaction.IsCodeDefaultInputVisible().Should().BeTrue("Code input is restored to default"); }
public void ThenISeeParticipantNameResultsMatchPredictiveSearch(string text) { TransactionForm transactionForm = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); List <string> results = transactionForm.PayToTheOrderOfSearchResults; results.First().Should().Contain(" | Add New Participant Record", "Name Search first result is to add new claimant"); foreach (string name in results) { name.Should().ContainEquivalentOf(text, "Pay to the Order Of search results include the given input string: " + text); } }
public void ClickEditButtonForTransactionsWithDescX(string text) { Thread.Sleep(3500); string trxType = ScenarioContext.Current.Get <string>("transactionName"); AddDataToScenarioContextOverridingExistentKey("toEditElementDesc", text); TransactionForm newTransaction = bankingTab.ClickEditButtonForTransactions(text, trxType); Assert.IsNotNull(newTransaction, "Edit button is Disabled due to permission restriction."); AddDataToScenarioContextOverridingExistentKey("New Transaction Form", newTransaction); AddDataToScenarioContextOverridingExistentKey("New Transaction Type", trxType); }
public void ClickEditButtonForDeposits(string text) { Thread.Sleep(1000); AddDataToScenarioContextOverridingExistentKey("toEditElementDesc", text); TransactionForm newDeposit = bankingTab.ClickEditButtonForTransactions(text, "Deposit"); Assert.IsNotNull(newDeposit, "Edit button is Disabled due to permission restriction."); Assert.True(newDeposit.TransactionFormTitle.Contains("Edit Deposit")); AddDataToScenarioContextOverridingExistentKey("New Transaction Form", newDeposit); AddDataToScenarioContextOverridingExistentKey("New Transaction Type", "Deposit"); Thread.Sleep(5000); }
public void ThenISeeCursorPositionIsField(string field) { //get form and verify the focus is on the field TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); switch (field) { case "Name": newTransaction.IsFocusOnNameField().Should().BeTrue("Focus is on Name field"); break; case "Amount": newTransaction.IsFocusOnAmountField().Should().BeTrue("Focus is on Amount field"); break; case "Description": newTransaction.IsFocusOnDescriptionField().Should().BeTrue("Focus is on Description field"); break; case "Non-Compensable": newTransaction.IsFocusOnNonCompensableField().Should().BeTrue("Focus is on Non-Compensable field"); break; case "Transaction": newTransaction.IsFocusOnTransactionField().Should().BeTrue("Focus is on Transaction field"); break; case "Cleared": newTransaction.IsFocusOnClearedField().Should().BeTrue("Focus is on Cleared field"); break; case "Code": newTransaction.IsFocusOnCodeField().Should().BeTrue("Focus is on Code field"); break; case "Add UTC Split": newTransaction.IsFocusOnAddUTCSplitField().Should().BeTrue("Focus is onAdd UTC Split field"); break; case "Serial #": newTransaction.IsFocusOnSerialNumberField().Should().BeTrue("Focus is on Check Serial # field"); break; default: ScenarioContext.Current.Pending(); break; } }
private void allTransactionToolStripMenuItem_Click(object sender, EventArgs e) { //TransactionForm aForm=new TransactionForm(); //aForm.ShowDialog(); try { pnlContext.Controls.Clear(); TransactionForm aRawMaterialsItemDetails = new TransactionForm(); aRawMaterialsItemDetails.Parent = this; pnlContext.Controls.Add(aRawMaterialsItemDetails); aRawMaterialsItemDetails.Dock = DockStyle.Fill; } catch (Exception exp) { } }
public void WhenIClickOnField(string field) { //get form and verify the focus is on the field TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); switch (field) { case "Serial #": newTransaction.ClickOnSerialNumber(); break; default: ScenarioContext.Current.Pending(); break; } }
public void ThenUserCanOnlyCreateTransactionsIfHavingBankingOrTrusteeRole() { CaseDetailPage caseDetailPage = ((CaseDetailPage)GetSharedPageObjectFromContext("Case Detail")); List <String> roles = ScenarioContext.Current.Get <List <string> >("Roles"); BankingDetailTab bankingTab = caseDetailPage.GoToBankingDetail(); if (roles.Contains("Banking") || roles.Contains("Trustee Role")) { //Check button bankingTab.IsCheckButtonInactive().Should().BeFalse("User has roles " + this.PrintableRoles(roles) + ", so Add Check button is active"); TransactionForm form = bankingTab.ClickCheckButton(); bankingTab.IsNewTransactionFormOpen().Should().BeTrue("User has roles " + this.PrintableRoles(roles) + ", so clicking Check button opens the Form"); form.Cancel(); //Deposit button bankingTab.IsDepositButtonInactive().Should().BeFalse("User has roles " + this.PrintableRoles(roles) + ", so Deposit button is active"); bankingTab.ClickDepositButton(); bankingTab.IsNewTransactionFormOpen().Should().BeTrue("User has roles " + this.PrintableRoles(roles) + ", so clicking Deposit button opens the Form"); } else { //Check button bankingTab.IsCheckButtonInactive().Should().BeTrue("User has roles " + this.PrintableRoles(roles) + ", so Add Check button is inactive"); try { bankingTab.ClickCheckButton(); bankingTab.IsNewTransactionFormOpen().Should().BeFalse("User has roles " + this.PrintableRoles(roles) + ", so clicking Check does nothing"); } catch (Exception) { //do nothing, if not clickeable the test passes } //Deposit button bankingTab.IsDepositButtonInactive().Should().BeTrue("User has roles " + this.PrintableRoles(roles) + ", so Deposit button is inactive"); try { bankingTab.ClickDepositButton(); bankingTab.IsNewTransactionFormOpen().Should().BeFalse("User has roles " + this.PrintableRoles(roles) + ", so clicking Deposit button does nothing"); } catch (Exception) { //do nothing, if not clickeable the test passes } } }
public void openTransactionX(string transactionName) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20)); WaitForBlockOverlayToDissapear(); Thread.Sleep(1000); AddDataToScenarioContextOverridingExistentKey("transactionName", transactionName); IWebElement button = createVisibleWebElementById("navItem-" + transactionName); Thread.Sleep(500); clickNotVisualizedElement(button); WaitForBlockOverlayToDissapear(); if (transactionName == "Check" || transactionName == "Adjustment Debit" || transactionName == "Wire Debit" || transactionName == "Record Funds Returned from a Payee or Creditor") { bankingTab.Pause(1); TransactionForm newCheck = new TransactionForm(driver, true, true); AddDataToScenarioContextOverridingExistentKey("New Transaction Form", newCheck); AddDataToScenarioContextOverridingExistentKey("New Transaction Type", "Check"); } if (transactionName == "Deposit" || transactionName == "Bank Service Charge Refund (Neg)" || transactionName == "Deposit Correcting Check" || transactionName == "Deposit Correcting Debit" || transactionName == "Wire Credit" || transactionName == "Adjustment Credit" || transactionName == "Bank Service Charge") { bankingTab.Pause(1); TransactionForm newCheck = new TransactionForm(driver, false, true); AddDataToScenarioContextOverridingExistentKey("New Transaction Form", newCheck); AddDataToScenarioContextOverridingExistentKey("New Transaction Type", "Deposit"); } if (transactionName == "Bank Service Charge Refund (Neg)") { transactionName = "Bank Service Charge Refund"; } else if (transactionName == "Transfer Out") { transactionName = "Transfer Funds"; } IWebElement trxTitle = createVisibleWebElementByXpath("//section[@id='newTransaction']/article//div/h4"); assertElementCouldContainThreeTexts(trxTitle, "Write " + transactionName, "Record " + transactionName, transactionName); WaitForBlockOverlayToDissapear(); }
private static Transaction MapTransactionFormToTransaction(TransactionForm transactionForm) { return(transactionForm.Id == null ? new Transaction { Name = transactionForm.Name, Description = transactionForm.Description, Amount = transactionForm.Amount, Date = transactionForm.Date, LinkedTransactionId = transactionForm.LinkedTransactionId } : new Transaction { Id = new ObjectId(transactionForm.Id), Name = transactionForm.Name, Description = transactionForm.Description, Amount = transactionForm.Amount, Date = transactionForm.Date, LinkedTransactionId = transactionForm.LinkedTransactionId }); }
public void ThenISeeCursorPositionIsButton(string button) { //get form and verify the focus is on the button TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); switch (button) { case "Save And Add Another": newTransaction.IsFocusOnSaveAndAddAnotherButton().Should().BeTrue("Focus is on Save And Add Another button"); break; case "Save": newTransaction.IsFocusOnSaveButton().Should().BeTrue("Focus is on Save button"); break; case "Cancel": newTransaction.IsFocusOnCancelButton().Should().BeTrue("Focus is on Cancel button"); break; default: ScenarioContext.Current.Pending(); break; } }
/// <summary> /// получить список транзакций по критериям /// </summary> /// <param name="transactionForm">вид транзакции</param> /// <param name="transactionDay">день транзакции</param> /// <param name="cardID">идентификатор </param> /// <returns></returns> public List <Transactions> GetTransactionsByFormAndDayAndCardId(TransactionForm transactionForm, DateTime transactionDay, long cardID) { DateTime sDate = new DateTime(transactionDay.Year, transactionDay.Month, transactionDay.Day, 0, 0, 0); DateTime eDate = new DateTime(transactionDay.Year, transactionDay.Month, transactionDay.Day, 23, 59, 59); //long lsDate = DBDateManager.GetDateInSeconds(sDate); //long leDate = DBDateManager.GetDateInSeconds(eDate); int form = (int)transactionForm; List <Transactions> transactionsList = null; using (var db = new mainEntities()) { var transactions = from t in db.Transactions where t.CardId == cardID && t.Form == form && t.Date <= eDate && t.Date >= sDate select t; if (transactions != null) { transactionsList = transactions.ToList(); } } return(transactionsList); }
public void GivenISeeTransactionAmountFieldPlaceholderIs(string expPlaceholder) { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.AmountPlaceholder.Should().Be(expPlaceholder, "Amount field displays expected placeholder"); }
public void GivenISeeTransactionAmountFieldValueIs(string expAmount) { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.Amount.Should().Be(expAmount, "Amount field displays expected amount"); }
public void WhenIClickOnTransactionAmountField() { TransactionForm newTransaction = ScenarioContext.Current.Get <TransactionForm>("New Transaction Form"); newTransaction.ClickOnAmountField(); }