Пример #1
0
        public async Task <OperationResult> Convert([FromRoute] int userId, [FromBody] ConvertForm form)
        {
            if (form.Amount <= 0)
            {
                return(new OperationResult(false, Constants.AmountShouldBePositive));
            }

            return(await walletService.Convert(userId, form.Amount, form.FromCurrency, form.ToCurrency));
        }
Пример #2
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.AddStore("model", Load);
            Remote.AddStore("history", LoadHistory);
            Remote.AddLookupData("Currency", CurrencyDataProvider.GetCurrencyList().Rates.Select(a => new Object[] {
                a.ISOCode,
                String.Format("{0} ({1})", a.Currency, a.ISOCode)
            }).ToArray());

            config["convertData"] = new ConvertForm
            {
                Amount = 100,
                Currency = "EUR"
            };
        }
Пример #3
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.AddStore("model", Load);
            Remote.AddStore("history", LoadHistory);
            Remote.AddLookupData("Currency", CurrencyDataProvider.GetCurrencyList().Rates.Select(a => new Object[] {
                a.ISOCode,
                String.Format("{0} ({1})", a.Currency, a.ISOCode)
            }).ToArray());

            config["convertData"] = new ConvertForm
            {
                Amount   = 100,
                Currency = "EUR"
            };
        }