public TransactionViewModel(Transaction transaction)
        {
            Id               = transaction.Id;
            SenderUniqueId   = transaction.SenderUniqueId;
            ReceiverUniqueId = transaction.ReceiverUniqueId;

            IExchangeUserStorage storage = Injector.Get <IExchangeUserStorage>();
            var senderName   = storage.GetExchangeUserByUniqueId(SenderUniqueId).Name;
            var receiverName = storage.GetExchangeUserByUniqueId(ReceiverUniqueId).Name;

            SenderName           = senderName;
            ReceiverName         = receiverName;
            TransactionComission = MiscUtils.FormatDouble(transaction.TransactionComission);
            TransactionValue     = MiscUtils.FormatDouble(transaction.TransactionValue);
            CreatedAt            = transaction.CreatedAt.ToLongDateString();
        }
Пример #2
0
        public ChainViewModel(Chain chain) : base()
        {
            Id               = chain.Id;
            SenderUniqueId   = chain.SenderUniqueId;
            ReceiverUniqueId = chain.ReceiverUniqueId;

            IExchangeUserStorage storage = Injector.Get <IExchangeUserStorage>();
            var sellerName = storage.GetExchangeUserByUniqueId(SenderUniqueId).Name;
            var buyerName  = storage.GetExchangeUserByUniqueId(ReceiverUniqueId).Name;

            SenderName   = sellerName;
            ReceiverName = buyerName;

            TransactionComission = MiscUtils.FormatDouble(chain.TransactionComission);
            TransactionValue     = MiscUtils.FormatDouble(chain.TransactionValue);
            PreviousHash         = chain.PreviousHash;
            CurrentHash          = chain.CurrentHash;
            CreatedAt            = chain.CreatedAt.ToLongDateString();
        }