private void txtPcs_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TransactionDate.Focus(); } }
public BorrowBookTransaction(LibraryUser libUser, BookCopy bookCopy) : base(bookCopy) { _BookCopyService = new BookCopyService(); _HolidayService = new HolidayService(); _BookInfoService = new BookService(); _SectionService = new SectionService(); var bookInfo = _BookInfoService.BookInfoOf(BookCopy); var section = _SectionService.GetBookSection(bookInfo); if (section == null) { throw new InvalidOperationException("The book does not belong to a section."); } if (section.MaxDaysAllowedForBorrowing == 0) { TransactionType = "Not Allowed For Borrowing."; } bookTransInfo = new TransactionInfo { BookCopyId = BookCopy.Id, LibraryUserId = libUser.Id, BorrowDate = TransactionDate, ExpectedReturnDate = _HolidayService.GetNonHolidayDateFrom(TransactionDate.AddDays(section.MaxDaysAllowedForBorrowing)) }; }
public void BankAccount_BankAccountStatementsHistorical_Output() { BankAccount bankAccount = new BankAccount(); Amount amount = new Amount(1000); //When bankAccount.Deposit(amount); bankAccount.Deposit(amount); bankAccount.Deposit(amount); bankAccount.Withdrawal(amount); bankAccount.Deposit(amount); bankAccount.Withdrawal(amount); //Then var statementsHistorical = bankAccount.Statements; var expectedDate = new TransactionDate().Value; var expectedOutput = new StringBuilder() .AppendLine() .AppendLine($"Date = {expectedDate} DEPOSIT Amount = 1000 Balance = 1000") .AppendLine($"Date = {expectedDate} DEPOSIT Amount = 1000 Balance = 2000") .AppendLine($"Date = {expectedDate} DEPOSIT Amount = 1000 Balance = 3000") .AppendLine($"Date = {expectedDate} WITHDRAWAL Amount = 1000 Balance = 2000") .AppendLine($"Date = {expectedDate} DEPOSIT Amount = 1000 Balance = 3000") .AppendLine($"Date = {expectedDate} WITHDRAWAL Amount = 1000 Balance = 2000") .ToString(); Check.That(statementsHistorical).IsEqualTo(expectedOutput); }
public override int GetHashCode() { return("Expense".GetHashCode() + 7 * ExpenseCategory.GetHashCode() + 13 * Amount.GetHashCode() + 17 * TransactionDate.GetHashCode()); }
public override string ToString() { return("Loaded :" + TransactionDate.ToString("yyyy/MM/dd") + Environment.NewLine + "Supplier : " + Supplier + Environment.NewLine + "Amount :R" + Amount.ToString("###,##0.00") + Environment.NewLine + "Reference :" + Reference); }
public void StartStopTransaction(int transactionId) { TimePlayZeroDbContextFactory fac = new TimePlayZeroDbContextFactory(); TimePlayZeroDbContext context = fac.CreateDbContext(null); var trans = context.Transactions.Where(w => w.Id == transactionId).FirstOrDefault(); if (trans == null) { return; } trans.State = trans.State == 0 ? 2 : 0; EnumTransactionDateType type = (EnumTransactionDateType)context.TransactionDates .Where(w => w.TransactionId == transactionId).OrderByDescending(o => o.Date) .Select(s => s.Type).FirstOrDefault(); TransactionDate transactionDate = new TransactionDate(); transactionDate.Date = DateTime.Now; transactionDate.TransactionId = transactionId; transactionDate.Type = type == EnumTransactionDateType.Start ? (int)EnumTransactionDateType.Stop : (int)EnumTransactionDateType.Start; context.TransactionDates.Add(transactionDate); context.SaveChangesAsync(); }
public override int GetHashCode() { return("Transfer".GetHashCode() + 7 * Source.GetHashCode() + 13 * Target.GetHashCode() + 17 * Amount.GetHashCode() + 19 * TransactionDate.GetHashCode()); }
private void TweakThenSave(SoaRowDTO dto) { dto.DocRefType = this.GetType().FullName; dto.DateOffset = TransactionDate.SoaRowOffset(); dto.Amount = Math.Abs(dto.Amount) * (IsDeposit ? 1.0M : -1.0M); _repo.UpsertAndUpdateBalances(dto); }
protected bool Equals(Transaction other) { return(Id == other.Id && TransactionDate.Equals(other.TransactionDate) && Created.Equals(other.Created) && string.Equals(Payee, other.Payee) && string.Equals(Reference, other.Reference) && Amount == other.Amount); }
private void saveTransactionButton_Click(object sender, RoutedEventArgs e) { Shop selectedShop = shopComboBox.SelectedItem as Shop; transactionController.Add(TransactionDate.ToString(), amountTextBox.Text, selectedShop, descriptionTextBox.Text); ClearForm(); RefreshTransactionsTable(); }
public int CompareTo(PaymentReportEntry other) { var result = string.Compare(Details, other.Details, StringComparison.Ordinal); if (result == 0) { result = TransactionDate.CompareTo(other.TransactionDate); } return(result); }
public override string ToString()//Override ToString which is used to format the send file statement { string username = Username; Thread.CurrentThread.CurrentCulture = new CultureInfo("el-gr"); var transactiondateformat = TransactionDate.ToString("yyyy-MM-dd HH:mm:ss.FFF", CultureInfo.InvariantCulture); var amount = Amount.ToString("C2", CultureInfo.CurrentCulture); return($"Your transaction was successful {username}, " + $"it took place on {transactiondateformat} and your current BALANCE is: {amount}"); }
public string this[string columnName] { get { if (columnName == "VehicleId") { if (null == VehicleId || VehicleId == 0) { return("Vehicle is required"); } } if (columnName == "DriverName") { if (string.IsNullOrEmpty(DriverName)) { return("Driver is required"); } } if (columnName == "TransactionDate") { if (null == TransactionDate || string.IsNullOrEmpty(TransactionDate.ToString())) { return("Filled date is required"); } } if (columnName == "CashAmount") { if (null == CashAmount || CashAmount <= 0) { return("Cash amount is required"); } } if (columnName == "ValueAmount") { if (null == ValueAmount || ValueAmount <= 0) { return("Value amount is required"); } } if (columnName == "LeafNo") { if (string.IsNullOrEmpty(LeafNo)) { return("Leaf# is required"); } } return(string.Empty); } }
private Order(string name, string email, string whatsapp, Districts districts, string address, string note, PaymentMethod paymentMethod, Func <DateTime, string> orderNumberGenerator) : this() { this.Customer = new OrderCustomer(name, email, whatsapp, address, districts); this.TransactionDate = DateTime.Now; this.OrderNumber = orderNumberGenerator.Invoke(this.TransactionDate); this.Payment = new OrderPayment(paymentMethod); this.Note = note; this.DueDateConfirmation = TransactionDate.AddDays(1); this.Status = OrderStatus.DRAFT; }
/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 44, Configuration.FieldSeparator), Id, SetIdFt1.HasValue ? SetIdFt1.Value.ToString(culture) : null, TransactionId, TransactionBatchId, TransactionDate?.ToDelimitedString(), TransactionPostingDate.HasValue ? TransactionPostingDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, TransactionType?.ToDelimitedString(), TransactionCode?.ToDelimitedString(), TransactionDescription, TransactionDescriptionAlt, TransactionQuantity.HasValue ? TransactionQuantity.Value.ToString(Consts.NumericFormat, culture) : null, TransactionAmountExtended?.ToDelimitedString(), TransactionAmountUnit?.ToDelimitedString(), DepartmentCode?.ToDelimitedString(), HealthPlanId?.ToDelimitedString(), InsuranceAmount?.ToDelimitedString(), AssignedPatientLocation?.ToDelimitedString(), FeeSchedule?.ToDelimitedString(), PatientType?.ToDelimitedString(), DiagnosisCodeFt1 != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosisCodeFt1.Select(x => x.ToDelimitedString())) : null, PerformedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, PerformedByCode.Select(x => x.ToDelimitedString())) : null, OrderedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, OrderedByCode.Select(x => x.ToDelimitedString())) : null, UnitCost?.ToDelimitedString(), FillerOrderNumber?.ToDelimitedString(), EnteredByCode != null ? string.Join(Configuration.FieldRepeatSeparator, EnteredByCode.Select(x => x.ToDelimitedString())) : null, ProcedureCode?.ToDelimitedString(), ProcedureCodeModifier != null ? string.Join(Configuration.FieldRepeatSeparator, ProcedureCodeModifier.Select(x => x.ToDelimitedString())) : null, AdvancedBeneficiaryNoticeCode?.ToDelimitedString(), MedicallyNecessaryDuplicateProcedureReason?.ToDelimitedString(), NdcCode?.ToDelimitedString(), PaymentReferenceId?.ToDelimitedString(), TransactionReferenceKey != null ? string.Join(Configuration.FieldRepeatSeparator, TransactionReferenceKey.Select(x => x.ToString(Consts.NumericFormat, culture))) : null, PerformingFacility != null ? string.Join(Configuration.FieldRepeatSeparator, PerformingFacility.Select(x => x.ToDelimitedString())) : null, OrderingFacility?.ToDelimitedString(), ItemNumber?.ToDelimitedString(), ModelNumber, SpecialProcessingCode != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialProcessingCode.Select(x => x.ToDelimitedString())) : null, ClinicCode?.ToDelimitedString(), ReferralNumber?.ToDelimitedString(), AuthorizationNumber?.ToDelimitedString(), ServiceProviderTaxonomyCode?.ToDelimitedString(), RevenueCode?.ToDelimitedString(), PrescriptionNumber, NdcQtyAndUom?.ToDelimitedString() ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
private void TransactionDetails_Load(object sender, EventArgs e) { lblProcessedBY.Text = AdminFullname; lblTransactionDate.Text = TransactionDate.ToShortDateString(); lblTransactionID.Text = TransactionID.ToString(); lblTransactionType.Text = TransactionType; if (TransactionType == "Borrowed an Equipment") { dgvTransactionDetails.DataSource = db.sp_ViewBorrowedEquipment(TransactionID); } }
public override async Task <TransactionDto> Create(CreateTransactionDto input) { try { TimePlayZeroDbContextFactory fac = new TimePlayZeroDbContextFactory(); TimePlayZeroDbContext context = fac.CreateDbContext(null); Transaction transaction = new Transaction(); transaction.CreationTime = DateTime.Now; transaction.Duration = input.Duration; transaction.CustomerName = input.CustomerName; transaction.PhoneNumber = input.PhoneNumber; transaction.Price = input.Price; transaction.State = input.State; transaction.ItemPriceCode = input.ItemPriceCode; transaction.ItemPriceId = input.ItemPriceId; transaction.CustomerId = input.CustomerId; transaction.Description = input.Description; transaction.IsUnlimited = input.IsUnlimited; context.Transactions.Add(transaction); int x = await context.SaveChangesAsync(); TransactionDate transactionDate = new TransactionDate(); transactionDate.Date = DateTime.Now; transactionDate.Type = (int)EnumTransactionDateType.Start; transactionDate.TransactionId = transaction.Id; context.TransactionDates.Add(transactionDate); int y = await context.SaveChangesAsync(); var res = MapToEntityDto(transaction); res.TotalPrice = transaction.Price; res.StartDate = transactionDate.Date; if (input.IsUnlimited) { res.DurationStr = L("IsUnlimited"); } else { res.DurationStr = res.Duration.ToString(); } return(res); } catch (Exception ex) { throw ex; } }
public override int GetHashCode() { unchecked { var hashCode = (lines != null ? lines.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TransactionDate.GetHashCode(); hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TransactionType != null ? TransactionType.GetHashCode() : 0); return(hashCode); } }
private Transaction( TransactionId id, decimal amount, Currency currency, TransactionDate date, TransactionStatus status) { TransactionId = id; Amount = amount; Currency = currency; TransactionDate = date; Status = status; }
public override int GetHashCode() { unchecked { var hashCode = Id.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionDate.GetHashCode(); hashCode = (hashCode * 397) ^ Created.GetHashCode(); hashCode = (hashCode * 397) ^ (Payee != null ? Payee.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Reference != null ? Reference.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Amount.GetHashCode(); return(hashCode); } }
public override string ToString() { var sb = new StringBuilder(); sb.Append("From" + " | ").Append("Transaction Type | ") .Append(" " + "To" + " | ").Append(" " + "Amount" + " |") .AppendLine("\t " + "\tDate" + "\t\t |") .Append(AccountHolder).Append("\t " + $"{TransactionType}" + " ") .Append(" " + LoggedUser + " ").Append(" " + $"{Amount.ToString("C", new CultureInfo("el-Gr"))}" + " ") .Append(" " + $"{TransactionDate.ToString("yyyy-MM- dd HH:mm:ss.FFF")}") .AppendLine(); return(sb.ToString()); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + (ActualCost == default(decimal) ? 0 : ActualCost.GetHashCode()); hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode()); hash = hash * 23 + (ProductId == default(int) ? 0 : ProductId.GetHashCode()); hash = hash * 23 + (Quantity == default(int) ? 0 : Quantity.GetHashCode()); hash = hash * 23 + (ReferenceOrderId == default(int) ? 0 : ReferenceOrderId.GetHashCode()); hash = hash * 23 + (ReferenceOrderLineId == default(int) ? 0 : ReferenceOrderLineId.GetHashCode()); hash = hash * 23 + (TransactionDate == default(DateTime) ? 0 : TransactionDate.GetHashCode()); hash = hash * 23 + (TransactionType == null ? 0 : TransactionType.GetHashCode()); return(hash); } }
public bool Equals(DealerPositionInfo another) { if (null == another) { return(false); } if (this == another) { return(true); } string tmpDate1 = TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); string tmpDate2 = another.TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); return(tmpDate1.Equals(tmpDate2) && Commodity.Equals(another.Commodity) && Month.Equals(another.Month) && VolumeDealers.Equals(another.VolumeDealers) && BuyDealers.Equals(another.BuyDealers) && SellDealers.Equals(another.SellDealers)); }
public bool Equals(ContractTransactionInfo another) { if (null == another) { return(false); } if (this == another) { return(true); } string dateString1 = TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); string dateString2 = another.TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); return(dateString1.Equals(dateString2) && Commodity.Equals(another.Commodity) && DoubleUtility.Equals(OpenPrice, another.OpenPrice) && DoubleUtility.Equals(HighPrice, another.HighPrice) && DoubleUtility.Equals(LowPrice, another.LowPrice) && DoubleUtility.Equals(ClosePrice, another.ClosePrice) && DoubleUtility.Equals(SettlePrice, another.SettlePrice) && Volume == another.Volume && Position == another.Position); }
public bool ExistIn(DealerPositionInfo another) { if (null == another) { return(false); } string date1 = TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); string date2 = another.TransactionDate.ToString(GlobalDefinition.DateFormat, GlobalDefinition.FormatProvider); bool result = date1.Equals(date2) && Commodity.Equals(another.Commodity) && Month.Equals(another.Month); string dealerList = ""; if (result) { switch (DealerInformationType) { case InformationType.VolumeInfo: dealerList = another.VolumeDealers; break; case InformationType.BuyInfo: dealerList = another.BuyDealers; break; case InformationType.SellInfo: dealerList = another.SellDealers; break; } string dealer; int amount; ExtractDealer(Rank, dealerList, out dealer, out amount); result = DealerName.Equals(dealer) && Amount == amount; } return(result); }
private static Result <TransactionDate> TryResolveTransactionDate(string date) => TransactionDate.Create(date);
public override string ToString() { return($"{TransactionDate.ToString(Formats.DateFormat)} {MerchantName.PadRight(10)} {string.Format(Formats.DecimalFormat, Fee)}"); }
public override string ToString() { return(String.Format("{0,-10}{1,20}{2,25}{3,30}", TransactionDate.ToString("MM/dd/yyyy hh:mm:ss tt"), Action, ChangeInBalance.ToString("C"), CurrentBalance.ToString("C"))); //return $"{TransactionDate.ToString("MM/dd/yyyy hh:mm:ss tt")} {Action} {ChangeInBalance.ToString("C")} {CurrentBalance.ToString("C")}"; }
private string GetHash() { string raw = $"{TruckId?.Trim()}{TransactionDate?.Trim()}{TransactionTime?.Trim()}{Units.ToString()}{NetCost.ToString()}"; return(GetMd5Hash(raw)); }
protected bool Equals(Transaction other) { return(lines.SequenceEqual(other.lines) && string.Equals(Id, other.Id) && TransactionDate.Equals(other.TransactionDate) && string.Equals(Username, other.Username) && string.Equals(Description, other.Description) && string.Equals(TransactionType, other.TransactionType)); }