Exemplo n.º 1
0
        public void Add(Fundings fundings)
        {
            if (fundings == null)
            {
                return;
            }

            Fundings.Add(fundings);
        }
Exemplo n.º 2
0
        public static FundingsJson ToFundingsJson(this Fundings fundings)
        {
            FundingsJson json = new FundingsJson();

            json.Address    = fundings.Address;
            json.Asset      = fundings.Asset.GetEnumDescription();
            json.Name       = fundings.Name;
            json.Tag        = fundings.Tag;
            json.Type       = fundings.Type.GetEnumDescription();
            json.Validation = fundings.Validation.GetEnumDescription();
            return(json);
        }
Exemplo n.º 3
0
        public static ListItem ToListItem(this Fundings fundings)
        {
            if (fundings == null)
            {
                return(null);
            }

            ListItem item = new ListItem();

            item.Text  = fundings.Name;
            item.Value = fundings.Name;
            return(item);
        }
Exemplo n.º 4
0
        public static void Select(this UpdateDropDownList uddl, Fundings fundings)
        {
            if (uddl == null || uddl.Items == null || fundings == null)
            {
                return;
            }

            ListItem item = fundings.ToListItem();

            if (item != null)
            {
                uddl.SelectValue(item.Value);
            }
        }
Exemplo n.º 5
0
        public static Fundings ToFundings(this FundingsJson json)
        {
            Fundings.Kind           kind       = Enums.ToEnumByDescription <Fundings.Kind>(json.Name);
            Kraken.Asset            asset      = Enums.ToEnumByDescription <Kraken.Asset>(json.Asset);
            Fundings.AccountType    type       = Enums.ToEnumByDescription <Fundings.AccountType>(json.Type);
            Fundings.ValidationType validation = Enums.ToEnumByDescription <Fundings.ValidationType>(json.Validation);

            Fundings fundings = new Fundings(kind, asset, type, validation);

            fundings.Address = json.Address;
            fundings.Tag     = json.Tag;

            return(fundings);
        }
Exemplo n.º 6
0
        public static bool EqualsType(this Fundings fundings, Fundings value)
        {
            if (fundings == null || value == null)
            {
                return(false);
            }

            if (
                fundings.Address == value.Address &&
                fundings.Asset == value.Asset &&
                fundings.Validation == value.Validation)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Defines if array contains similar fundings by its name, asset and validation type
        /// </summary>
        /// <param name="fundings"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static bool ContainsType(this Fundings[] fundings, Fundings value)
        {
            if (fundings == null || fundings.Length <= 0 || value == null)
            {
                return(false);
            }

            foreach (Fundings f in fundings)
            {
                if (f.EqualsType(value))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 8
0
        public void InitializeFundingsManager()
        {
            Fundings = new FundingsManager();

            Fundings fundings = new Fundings(
                Asmodat_Web_Exchange.Fundings.Kind.PayPal,
                Asmodat.Kraken.Kraken.Asset.EUR,
                Asmodat_Web_Exchange.Fundings.AccountType.Withdraw,
                Asmodat_Web_Exchange.Fundings.ValidationType.EMail);

            fundings.AddressRequired = true;
            Fundings.Add(fundings);

            Fundings fundings4 = new Fundings(
                Asmodat_Web_Exchange.Fundings.Kind.Bitcoin,
                Asmodat.Kraken.Kraken.Asset.XBT,
                Asmodat_Web_Exchange.Fundings.AccountType.Withdraw,
                Asmodat_Web_Exchange.Fundings.ValidationType.Bitcoin);

            fundings4.AddressRequired = true;
            Fundings.Add(fundings4);

            Fundings fundings2 = new Fundings(
                Asmodat_Web_Exchange.Fundings.Kind.PayPal,
                Asmodat.Kraken.Kraken.Asset.EUR,
                Asmodat_Web_Exchange.Fundings.AccountType.Deposit,
                Asmodat_Web_Exchange.Fundings.ValidationType.None);

            fundings2.AddressRequired = false;
            Fundings.Add(fundings2);

            Fundings fundings3 = new Fundings(
                Asmodat_Web_Exchange.Fundings.Kind.Bitcoin,
                Asmodat.Kraken.Kraken.Asset.XBT,
                Asmodat_Web_Exchange.Fundings.AccountType.Deposit,
                Asmodat_Web_Exchange.Fundings.ValidationType.Bitcoin);

            fundings3.AddressRequired = true;
            Fundings.Add(fundings3);
        }
        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;
            }
        }