csharp/aabiryukov/CryptoMarketApi/Api/BtcChinaApi/Order.cs

Order.cs
using Newtonsoft.Json.Linq;
using System;

namespace BTCChina
{
	public clast Order
	{
		public int OrderId { get; private set; }
		public string OrderType { get; private set; }
		public decimal Price { get; private set; }
		public string Currency { get; private set; }
		public decimal Amount { get; private set; }
		public decimal OriginalAmount { get; private set; }
		public UInt32 Date { get; private set; }
		public string Status { get; private set; }

		public static Order ReadFromJObject(JToken o)
		{
			if (o == null)
				return null;
			return new Order()
			{
				OrderId = o.Value("id"),
				OrderType = o.Value("type"),
				Price = o.Value("price"),
				Currency = o.Value("currency"),
				Amount = o.Value("amount"),
				OriginalAmount = o.Value("amount_original"),
				Date = o.Value("date"),
				Status = o.Value("status"),
			};
		}
	}
}