private void AcceptTransaction_Clicked(object sender, EventArgs e)
        {
            decimal currAmount = decimal.Parse(CurrencyAmount.Text);
            string  currency   = CurrencySign.Text.ToString();

            WCFKantor.UserDetails user = new WCFKantor.UserDetails()
            {
                UserEmail = Login.emailUser.ToString()
            };
            WCFKantor.Service1Client    client   = new WCFKantor.Service1Client();
            Dictionary <string, string> userData = client.PobierzDane(user);
            string getExchange = client.GetExchangeRate(currency);
            int    a           = getExchange.LastIndexOf("i");

            getExchange = getExchange.Substring(a + 2);
            decimal exchange = decimal.Parse(getExchange, CultureInfo.InvariantCulture);
            decimal score    = decimal.Parse((currAmount / exchange).ToString("N4"));

            WCFKantor.Transactions transaction = new WCFKantor.Transactions()
            {
                UserID = Int32.Parse(userData["ID"]), Type = "SPRZEDAJ", Pln = currAmount, Currency = currency, Exchange = exchange, Score = score
            };
            string result = client.SetTransakcje(transaction);

            CheckLabel.Text = result;
            client.CloseAsync();
        }
Beispiel #2
0
        public TransactionHistory()
        {
            InitializeComponent();
            WCFKantor.Transactions   transaction = new WCFKantor.Transactions();
            WCFKantor.Service1Client client      = new WCFKantor.Service1Client();

            Dictionary <string, decimal> accountData = new Dictionary <string, decimal>();

            foreach (KeyValuePair <string, decimal> currency in accountData)
            {
                TransactionInfo.Children.Add(new Label {
                    Text = currency.Key + ":"
                });
                TransactionInfo.Children.Add(new Label {
                    Text = currency.Value.ToString()
                });
            }
            client.CloseAsync();
        }
 public System.Threading.Tasks.Task <string> SetTransakcjeAsync(WCFKantor.Transactions transaction)
 {
     return(base.Channel.SetTransakcjeAsync(transaction));
 }
 public string SetTransakcje(WCFKantor.Transactions transaction)
 {
     return(base.Channel.SetTransakcje(transaction));
 }