private void InitializeWithdraw() { if (SManager == null) { return; } InfoExchange info = SManager.AssetBuy; if (!info.IsValid()) { return; } Fundings[] fundings = Manager.Fundings.Get(Fundings.AccountType.Withdraw, info.Asset.Value); Fundings[] results = UDdlWithdraw.AddItems(fundings); if (!results.ContainsType(SManager.FundingWithdraw.Fundings)) { SManager.FundingWithdraw.Fundings = null; } if (SManager.FundingWithdraw.Fundings == null && UDdlWithdraw.Items.Count > 0) { UDdlWithdraw.SelectedIndex = 0; SManager.FundingWithdraw.Fundings = results[UDdlWithdraw.SelectedIndex]; } if (SManager.FundingWithdraw.Fundings != null) { UDdlWithdraw.SelectValue(SManager.FundingWithdraw.Fundings.Name); } }
public static void ToInfoExchange(this ExchangeJson json, ref InfoExchange exchanage) { exchanage.AssetName = json.AssetName; exchanage.Amount = json.Amount; exchanage.Buy = json.Buy; exchanage.Sell = json.Sell; exchanage.IsFixed = json.IsFixed; }
public static bool IsValid(this InfoExchange info) { if (info != null && info.Asset != null && info.Asset.HasValue && info.Buy != info.Sell) { return(true); } return(false); }
public SessionManager(System.Web.SessionState.HttpSessionState Session) { this.Session = Session; AssetPrimary = new InfoExchange(Session, "ExchangeControl.AssetPrimary."); AssetSecondary = new InfoExchange(Session, "ExchangeControl.AssetSecondary."); FundingDeposit = new InfoFunding(Session, "FundingsControl.FundingDeposit."); FundingWithdraw = new InfoFunding(Session, "FundingsControl.FundingWithdraw."); ExchangeOrder = new InfoExchangeOrder(Session, "OrderControl.ExchangeOrder."); TrackingOrder = new InfoTracking(Session, "TrackingControl.TrackingOrder."); }
/// <summary> /// Converts InfoExchange to Json class /// </summary> /// <param name="exchange"></param> /// <returns></returns> public static ExchangeJson ToExchangeJson(this InfoExchange exchange) { ExchangeJson json = new ExchangeJson(); json.AssetName = exchange.AssetName; json.Amount = exchange.Amount; json.Buy = exchange.Buy; json.Sell = exchange.Sell; json.IsFixed = exchange.IsFixed; return(json); }
private void InitializeWithdrawFundinng() { if (SManager == null || SManager.FundingDeposit == null || SManager.FundingWithdraw == null) { return; } InfoExchange info = SManager.AssetBuy; if (!info.IsValid()) { return; } Fundings fundings = Manager.Fundings.Get(Fundings.AccountType.Withdraw, info.Asset.Value, UDdlWithdraw.Text); if (fundings != null) { SManager.FundingWithdraw.Fundings = fundings.Copy(); UTbxWithdraw.Text = null; } else { SManager.FundingWithdraw.Fundings = null; return; } if (!SManager.FundingWithdraw.Fundings.AddressRequired) { UTbxWithdraw.Text = "Address not required"; UTbxWithdraw.ReadOnly = true; } else { UTbxWithdraw.Text = SManager.FundingWithdraw.Address; UTbxWithdraw.ReadOnly = false; } }