示例#1
0
        public static jsonTransaction FromTransaction(Transaction _Transaction)
        {
            jsonTransaction tmp = new jsonTransaction {
                available       = _Transaction.Available,
                available_delta = _Transaction.AvailableDelta,
                balance         = _Transaction.Balance,
                balance_delta   = _Transaction.BalanceDelta,
                currency        = _Transaction.Currency,
                description     = _Transaction.Description,
                row_index       = _Transaction.RowIndex,
                timestamp       = JSON.ToEpoch(_Transaction.TimeStamp)
            };

            return(tmp);
        }
示例#2
0
        public static Transaction ToTransaction(jsonTransaction Transaction)
        {
            Transaction tmp = new Accounts.Transaction {
                /*Available=decimal.Parse(Transaction.available, System.Globalization.NumberFormatInfo.InvariantInfo),
                 * AvailableDelta= decimal.Parse(Transaction.available_delta, System.Globalization.NumberFormatInfo.InvariantInfo),
                 * Balance= decimal.Parse(Transaction.balance, System.Globalization.NumberFormatInfo.InvariantInfo),
                 * BalanceDelta= decimal.Parse(Transaction.balance_delta, System.Globalization.NumberFormatInfo.InvariantInfo),*/
                Available      = Transaction.available,
                AvailableDelta = Transaction.available_delta,
                Balance        = Transaction.balance,
                BalanceDelta   = Transaction.balance_delta,
                Currency       = Transaction.currency,
                Description    = Transaction.description,
                RowIndex       = Transaction.row_index,
                TimeStamp      = JSON.FromEpoch(Transaction.timestamp)
            };

            return(tmp);
        }
示例#3
0
 public Transaction FromJsonTransaction(jsonTransaction _Transaction)
 {
     return(_Transaction.ToTransaction());
 }