Beispiel #1
0
        /// <summary>
        /// Refreshing GridView Items
        /// </summary>
        public void RefreshGridview()
        {
            var proxy = new Proxy.Proxy();

            AccountGridView.ItemsSource = proxy.GetUserAccounts(Windows.MainWindow.Credentials);
            AccountGridView.Items.Refresh();
        }
        private bool CheckTransferParameters()
        {
            var proxy = new Proxy.Proxy();

            if (!AccountUtils.ValidateAccountNumber(AccountFromTextBox.Text) ||
                proxy.GetUserAccounts(MainWindow.Credentials).FirstOrDefault(x => x.BankAccountNumber == AccountFromTextBox.Text) == null)
            {
                ClientUtils.ShowMessage(new ErrorMessage(_resourceWrapper.InvalidBankAccountFrom));
                return(false);
            }
            if (!AccountUtils.ValidateAccountNumber(AccountToTextBox.Text))
            {
                ClientUtils.ShowMessage(new ErrorMessage(_resourceWrapper.InvalidBankAccountTo));
                return(false);
            }
            if (AccountFromTextBox.Text == AccountToTextBox.Text)
            {
                ClientUtils.ShowMessage(new ErrorMessage(_resourceWrapper.SameFromToBankAccounts));
                return(false);
            }
            if (TitleTextBox.Text == "")
            {
                ClientUtils.ShowMessage(new ErrorMessage(_resourceWrapper.NoTitleError));
                return(false);
            }

            decimal amountDec;

            if (decimal.TryParse(AmountTextBox.Text.Replace(".", ","), out amountDec) && amountDec > 0)
            {
                return(true);
            }

            ClientUtils.ShowMessage(new ErrorMessage(_resourceWrapper.WrongAmount));
            return(false);
        }