//------------------------------------------------------------------------- public override void load(EbPropSet prop_set) { Name = prop_set.getPropString("T_Name").get(); var prop_state = prop_set.getPropInt("I_State"); State = prop_state == null ? DataState.Default : (DataState)prop_state.get(); CoinCount = prop_set.getPropInt("I_CoinCount").get(); var prop_coin = prop_set.getPropInt("I_CoinType"); CoinType = prop_coin == null ? CoinTypeEnum.Default : (CoinTypeEnum)prop_coin.get(); CoinScore = prop_set.getPropInt("I_CoinScore").get(); }
/// <summary> /// Initializes a new instance of the <see cref="Currency" /> class. /// </summary> /// <param name="minConfirmations">Minimum number of block chain confirmations before deposit is accepted..</param> /// <param name="minWithdrawalFee">The minimum transaction fee paid for withdrawals.</param> /// <param name="disabledDepositAddressCreation">False if deposit address creation is disabled.</param> /// <param name="currency">The abbreviation of the currency. This abbreviation is used elsewhere in the API to identify the currency. (required).</param> /// <param name="currencyLong">The full name for the currency. (required).</param> /// <param name="withdrawalFee">The total transaction fee paid for withdrawals (required).</param> /// <param name="feePrecision">fee precision.</param> /// <param name="withdrawalPriorities">withdrawalPriorities.</param> /// <param name="coinType">The type of the currency. (required).</param> public Currency(int?minConfirmations = default(int?), decimal?minWithdrawalFee = default(decimal?), bool?disabledDepositAddressCreation = default(bool?), string currency = default(string), string currencyLong = default(string), decimal?withdrawalFee = default(decimal?), int?feePrecision = default(int?), List <CurrencyWithdrawalPriorities> withdrawalPriorities = default(List <CurrencyWithdrawalPriorities>), CoinTypeEnum coinType = default(CoinTypeEnum)) { // to ensure "currency" is required (not null) if (currency == null) { throw new InvalidDataException("currency is a required property for Currency and cannot be null"); } else { this._Currency = currency; } // to ensure "currencyLong" is required (not null) if (currencyLong == null) { throw new InvalidDataException("currencyLong is a required property for Currency and cannot be null"); } else { this.CurrencyLong = currencyLong; } // to ensure "withdrawalFee" is required (not null) if (withdrawalFee == null) { throw new InvalidDataException("withdrawalFee is a required property for Currency and cannot be null"); } else { this.WithdrawalFee = withdrawalFee; } // to ensure "coinType" is required (not null) if (coinType == null) { throw new InvalidDataException("coinType is a required property for Currency and cannot be null"); } else { this.CoinType = coinType; } this.MinConfirmations = minConfirmations; this.MinWithdrawalFee = minWithdrawalFee; this.DisabledDepositAddressCreation = disabledDepositAddressCreation; this.FeePrecision = feePrecision; this.WithdrawalPriorities = withdrawalPriorities; }
public static void WriteCoinType() { using (var ctx = new VarlikContext()) { CoinTypeEnum coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "BTC"; coinTypeEnum.Name = "BitCoin"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "LTC"; coinTypeEnum.Name = "LiteCoin"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "DOGE"; coinTypeEnum.Name = "DogeCoin"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "IOTA"; coinTypeEnum.Name = "IOTA"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "ETH"; coinTypeEnum.Name = "ETH"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); coinTypeEnum = new CoinTypeEnum(); coinTypeEnum.Code = "XRP"; coinTypeEnum.Name = "XRP"; ctx.CoinTypeEnum.Add(coinTypeEnum); ctx.SaveChanges(); } }