public override int GetHashCode() { int hashCode = -1998789331; hashCode = hashCode * -1521134295 + ConsulatationFeeID.GetHashCode(); hashCode = hashCode * -1521134295 + DoctorID.GetHashCode(); hashCode = hashCode * -1521134295 + HospitalID.GetHashCode(); hashCode = hashCode * -1521134295 + FeeAmount.GetHashCode(); hashCode = hashCode * -1521134295 + DoctorAmount.GetHashCode(); hashCode = hashCode * -1521134295 + StartDate.GetHashCode(); hashCode = hashCode * -1521134295 + EndDate.GetHashCode(); return(hashCode); }
public FeeAmountViewModelGet(FeeAmount feeAmount) { Satoshis = feeAmount.Satoshis; Bytes = feeAmount.Bytes; }
/// <summary> /// Method that will be called on an entity immediately before the item is saved by context /// </summary> /// <param name="dbContext"></param> /// <param name="entry"></param> public override void PreSaveChanges(Rock.Data.DbContext dbContext, DbEntityEntry entry) { var rockContext = ( RockContext )dbContext; HistoryChangeList = new History.HistoryChangeList(); switch (entry.State) { case EntityState.Added: { string acct = History.GetValue <FinancialAccount>(this.Account, this.AccountId, rockContext); HistoryChangeList.AddChange(History.HistoryVerb.Add, History.HistoryChangeType.Record, acct).SetNewValue(Amount.FormatAsCurrency()); break; } case EntityState.Modified: { string acct = History.GetValue <FinancialAccount>(this.Account, this.AccountId, rockContext); int?accountId = this.Account != null ? this.Account.Id : this.AccountId; int?origAccountId = entry.OriginalValues["AccountId"].ToStringSafe().AsIntegerOrNull(); if (!accountId.Equals(origAccountId)) { History.EvaluateChange(HistoryChangeList, "Account", History.GetValue <FinancialAccount>(null, origAccountId, rockContext), acct); } History.EvaluateChange(HistoryChangeList, acct, entry.OriginalValues["Amount"].ToStringSafe().AsDecimal().FormatAsCurrency(), Amount.FormatAsCurrency()); History.EvaluateChange(HistoryChangeList, acct, entry.OriginalValues["FeeAmount"].ToStringSafe().AsDecimal().FormatAsCurrency(), FeeAmount.FormatAsCurrency()); History.EvaluateChange(HistoryChangeList, acct, entry.OriginalValues["FeeCoverageAmount"].ToStringSafe().AsDecimal().FormatAsCurrency(), FeeCoverageAmount.FormatAsCurrency()); break; } case EntityState.Deleted: { string acct = History.GetValue <FinancialAccount>(this.Account, this.AccountId, rockContext); HistoryChangeList.AddChange(History.HistoryVerb.Delete, History.HistoryChangeType.Record, acct).SetOldValue(Amount.FormatAsCurrency()); break; } } base.PreSaveChanges(dbContext, entry); }
public FeeAmountViewModelCreate(FeeAmount feeAmount) : base(feeAmount) { }