Beispiel #1
0
 public DebtDetailResponse ToDebtDetail(DynamicsGatewayOptions options)
 {
     return(new DebtDetailResponse
     {
         Id = Id,
         Amount = decimal.Parse(Amount),
         Reference = CreditorExternalReference,
         DebtTypeName = Type,
         NINO = NationalInsuranceNumber,
         CreatedOn = CreatedOn.ToDateTimeOffset(),
         ModifiedOn = ModifiedOn.ToDateTimeOffset(),
         Status = options.DebtStatus[StatusId.ToString()],
         SoldToCreditorName = ProposedCreditor?.Name,
         SoldToCreditorId = ProposedCreditor?.Id,
         PreviouslySold = PreviouslySold,
         CreditorName = Creditor.Name,
         CreditorId = Creditor.Id,
         StartsOn = CommencementDate?.ToDateTimeOffset(),
         EndsOn = ExpiryDate?.ToDateTimeOffset(),
         RemovedOn = RemovalDate?.ToDateTimeOffset(),
         DebtTypeId = TypeId,
         DebtEligibilityReview = DebtEligibilityReview != null
             ? DebtEligibilityReview.ToDebtEligibilityReview(options)
             : null,
         DebtRemovalReason = DebtRemovalReasonId.HasValue ?
                             options.DebtRemovalReason.First(r => r.Value == DebtRemovalReasonId.ToString()).Key :
                             (DebtRemovalReason?)null
     });
 }
 public void Refresh()
 {
     if (NTMinerRoot.Instance.CalcConfigSet.TryGetCalcConfig(_coinVm, out ICalcConfig calcConfig))
     {
         var incomePerDay = NTMinerRoot.Instance.CalcConfigSet.GetIncomePerHashPerDay(_coinVm.Code);
         var v            = this.Speed.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCoin;
         if (v >= 100)
         {
             IncomePerDayText = v.ToString("f2");
         }
         else
         {
             IncomePerDayText = v.ToString("f7");
         }
         IncomeCnyPerDayText = (this.Speed.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCny).ToString("f2");
         CoinPriceCnyText    = (incomePerDay.IncomeCny / incomePerDay.IncomeCoin).ToString("f2");
         ModifiedOn          = incomePerDay.ModifiedOn;
         if (ModifiedOn.AddMinutes(15) < DateTime.Now)
         {
             BackgroundBrush = Red;
         }
         else
         {
             BackgroundBrush = White;
         }
     }
     else
     {
         IncomePerDayText    = "0";
         IncomeCnyPerDayText = "0";
         CoinPriceCnyText    = "0";
         ModifiedOn          = DateTime.MinValue;
         BackgroundBrush     = Red;
     }
 }
Beispiel #3
0
 /// <summary>
 /// Returns a <see cref="System.String"/> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String"/> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return(OperationType + " DateTime=" + ModifiedOn.ToLocalTime()
            + (AuditedObject == null ? "" : " AuditedObject=(" + AuditedObject + ")")
            + (string.IsNullOrEmpty(PropertyName) ? "" : "PropertyName=(" + PropertyName + ")")
            + (NewObject == null ? "" : " NewObject=(" + NewObject + ")")
            + (OldObject == null ? "" : " OldObject=(" + OldObject + ")")
            + (NewObject != null ? "" : " NewValue=(" + NewValue + ")")
            + (OldObject != null ? "" : " OldValue=(" + OldValue + ")"));
 }
        protected override void OnParametersSet()
        {
            _text = string.Empty;
            if (!String.IsNullOrEmpty(CreatedBy) || CreatedOn != null)
            {
                _text += "<p style=\"" + Style + "\">Created ";

                if (!String.IsNullOrEmpty(CreatedBy))
                {
                    _text += " by <b>" + CreatedBy + "</b>";
                }

                if (CreatedOn != null)
                {
                    _text += " on <b>" + CreatedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
                }

                _text += "</p>";
            }

            if (!String.IsNullOrEmpty(ModifiedBy) || ModifiedOn != null)
            {
                _text += "<p style=\"" + Style + "\">Last modified ";

                if (!String.IsNullOrEmpty(ModifiedBy))
                {
                    _text += " by <b>" + ModifiedBy + "</b>";
                }

                if (ModifiedOn != null)
                {
                    _text += " on <b>" + ModifiedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
                }

                _text += "</p>";
            }

            if (!String.IsNullOrEmpty(DeletedBy) || DeletedOn.HasValue)
            {
                _text += "<p style=\"" + Style + "\">Deleted ";

                if (!String.IsNullOrEmpty(DeletedBy))
                {
                    _text += " by <b>" + DeletedBy + "</b>";
                }

                if (DeletedOn != null)
                {
                    _text += " on <b>" + DeletedOn.Value.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
                }

                _text += "</p>";
            }
        }
 /// <inheritdoc />
 public bool Equals(Expectation other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id == other.Id && CreatedOn.Equals(other.CreatedOn) && ModifiedOn.Equals(other.ModifiedOn) && Equals(Timestamp, other.Timestamp) && Equals(HttpRequest, other.HttpRequest) && Equals(HttpResponse, other.HttpResponse) && Equals(HttpResponseTemplate, other.HttpResponseTemplate) && Equals(HttpForward, other.HttpForward) && Equals(HttpForwardTemplate, other.HttpForwardTemplate) && Equals(HttpError, other.HttpError) && Equals(Times, other.Times) && Equals(TimeToLive, other.TimeToLive));
 }
Beispiel #6
0
        public StringBuilder GetSignData()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(nameof(Id)).Append(Id)
            .Append(nameof(Name)).Append(Name)
            .Append(nameof(ServerJsonSha1)).Append(ServerJsonSha1)
            .Append(nameof(Description)).Append(Description)
            .Append(nameof(CreatedOn)).Append(CreatedOn.ToUlong())
            .Append(nameof(ModifiedOn)).Append(ModifiedOn.ToUlong());
            return(sb);
        }
 public DebtEligibilityReviewResponse ToDebtEligibilityReview(DynamicsGatewayOptions options)
 {
     return(new DebtEligibilityReviewResponse
     {
         CreditorNotes = CreditorNotes,
         Reason = (DebtEligibilityReviewReasons)int.Parse(options.DebtEligibilityReviewReasons
                                                          .First(r => r.Value == ReasonId.ToString()).Key),
         Status = options.DebtEligibilityReviewStatus[StatusId.ToString()],
         MoneyAdviserNotes = MoneyAdviserNotes,
         CreatedOn = CreatedOn.ToDateTimeOffset(),
         ModifiedOn = ModifiedOn.ToDateTimeOffset(),
     });
 }
 public DebtorEligibilityReviewResponse ToDebtorEligibilityReview(DynamicsGatewayOptions options)
 {
     return(new DebtorEligibilityReviewResponse
     {
         CreditorId = CreditorId,
         CreditorNotes = CreditorNotes,
         MoneyAdviserNotes = MoneyAdviserNotes,
         CreditorName = Creditor,
         Status = options.DebtorEligibilityReviewStatus[StatusId.ToString()],
         CreatedOn = CreatedOn.ToDateTimeOffset(),
         EndReason = options.GetEligibilityReviewParentReasonById(ReasonId),
         ModifiedOn = ModifiedOn.ToDateTimeOffset(),
         NoLongerEligibleReason = SubreasonId != Guid.Empty
             ? options.GetEligibilityReviewChildReasonById(SubreasonId)
             : null
     });
 }
Beispiel #9
0
 public void Refresh()
 {
     if (NTMinerRoot.Instance.CalcConfigSet.TryGetCalcConfig(_coinVm, out ICalcConfig calcConfig))
     {
         NetSpeedText = calcConfig.NetSpeed > 0 ? calcConfig.NetSpeed.ToString() : string.Empty;
         NetSpeedUnit = calcConfig.NetSpeedUnit;
         if (calcConfig.DayWave > 0)
         {
             DayWaveText  = $"+{(calcConfig.DayWave * 100).ToString("f2")}%";
             DayWaveBrush = WpfUtil.GreenBrush;
         }
         else if (calcConfig.DayWave == 0)
         {
             DayWaveText  = "0%";
             DayWaveBrush = LightRed;
         }
         else
         {
             DayWaveText  = $"{(calcConfig.DayWave * 100).ToString("f2")}%";
             DayWaveBrush = WpfUtil.RedBrush;
         }
         var incomePerDay = NTMinerRoot.Instance.CalcConfigSet.GetIncomePerHashPerDay(_coinVm.Code);
         var v            = this.Speed.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCoin;
         if (v >= 100)
         {
             IncomePerDaySumText = v.ToString("f2");
         }
         else
         {
             IncomePerDaySumText = v.ToString("f7");
         }
         v = 1.0.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCoin;
         if (v >= 100)
         {
             IncomePerDayText = v.ToString("f2");
         }
         else
         {
             IncomePerDayText = v.ToString("f7");
         }
         IncomeCnyPerDaySumText = (this.Speed.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCny).ToString("f2");
         IncomeCnyPerDayText    = (1.0.FromUnitSpeed(this.SpeedUnitVm.Unit) * incomePerDay.IncomeCny).ToString("f2");
         CoinPriceCnyText       = (incomePerDay.IncomeCny / incomePerDay.IncomeCoin).ToString("f2");
         ModifiedOn             = incomePerDay.ModifiedOn;
         if (ModifiedOn.AddMinutes(15) < DateTime.Now)
         {
             BackgroundBrush = LightRed;
         }
         else
         {
             BackgroundBrush = WpfUtil.TransparentBrush;
         }
         OnPropertyChanged(nameof(SpeedUnitVm));
     }
     else
     {
         IncomePerDaySumText    = "0";
         IncomeCnyPerDaySumText = "0";
         IncomePerDayText       = "0";
         IncomeCnyPerDayText    = "0";
         CoinPriceCnyText       = "0";
         NetSpeedText           = string.Empty;
         NetSpeedUnit           = string.Empty;
         DayWaveText            = string.Empty;
         ModifiedOn             = DateTime.MinValue;
         BackgroundBrush        = WpfUtil.RedBrush;
     }
 }