Exemplo n.º 1
0
        public ViewResult Index()
        {
            var model = new AccountsViewModel();

            model.Accounts = _db.Query(new GetAllAccountsQuery());
            return(View(model));
        }
Exemplo n.º 2
0
 public AccountsWindow(AccountsViewModel accountsViewModel, IDataStore dataStore)
 {
     _dataStore         = dataStore;
     _accountsViewModel = accountsViewModel;
     DataContext        = accountsViewModel;
     InitializeComponent();
 }
Exemplo n.º 3
0
        // GET: Accounts
        public async Task <IActionResult> Index(string searchStatus, string searchString)
        {
            IQueryable <bool> accountsQuery = from a in _context.Accounts
                                              select a.Status;

            var accounts = from a in _context.Accounts
                           .OrderBy(a => a.Name)
                           select a;

            if (!string.IsNullOrEmpty(searchString))
            {
                accounts = accounts.Where(n => n.Name.Contains(searchString));
            }

            if (!string.IsNullOrEmpty(searchStatus) && (searchStatus.ToString() != "all"))
            {
                accounts = accounts.Where(s => s.Status == Convert.ToBoolean(searchStatus));
            }
            if (string.IsNullOrEmpty(searchStatus))
            {
                accounts = accounts.Where(s => s.Status == true);
            }

            var accountsViewModel = new AccountsViewModel
            {
                Status   = new SelectList(await accountsQuery.Distinct().ToListAsync(), bool.Parse("True")),
                Accounts = await accounts.ToListAsync()
            };

            return(View(accountsViewModel));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Index()
        {
            _logger.LogInformation("Index");
            var accessToken = _contextAccessor.HttpContext.GetTokenAsync("access_token");

            var value = User.FindFirst(c => c.Type == ClaimTypes.NameIdentifier)?.Value;

            long.TryParse(value, out long membershipId);

            var linkedProfiles = await _destiny.GetLinkedProfiles(await accessToken, membershipId);

            var accounts = linkedProfiles.Profiles.Select(profile => new Account(profile.MembershipType, profile.MembershipId))
                           .ToList();

            if (1 == accounts.Count)
            {
                _logger.LogInformation("Only one account - redirecting to account page");

                // If there is only one account, redirect to the page for it.
                var url = Url.RouteUrl("AccountDetails", new
                {
                    type = (int)accounts[0].Type,
                    id   = accounts[0].Id
                });
                return(Redirect(url));
            }

            var model = new AccountsViewModel();

            model.Accounts = accounts;
            return(View(model));
        }
Exemplo n.º 5
0
        public void ConfigureServices(IServiceCollection services)
        {
            var web3ServiceProvider                  = new Web3ProviderService();
            var accountsService                      = new AccountsService(web3ServiceProvider);
            var newBlockProcessingService            = new NewBlockProcessingService(web3ServiceProvider);
            var toastsViewModel                      = new ToastsViewModel();
            var blocksViewModel                      = new BlocksViewModel(newBlockProcessingService);
            var latestBlockTransactionsViewModel     = new LatestBlockTransactionsViewModel(web3ServiceProvider);
            var newAccountPrivateKeyViewModel        = new NewAccountPrivateKeyViewModel();
            var accountsViewModel                    = new AccountsViewModel(accountsService, newAccountPrivateKeyViewModel);
            var accountsTransactionMonitoringService = new AccountsTransactionMonitoringService(accountsService, web3ServiceProvider);


            services.AddSingleton <IWeb3ProviderService, Web3ProviderService>((x) => web3ServiceProvider);
            services.AddSingleton <IAccountsService, AccountsService>((x) => accountsService);
            services.AddSingleton <NewBlockProcessingService>(newBlockProcessingService);
            services.AddSingleton <ToastsViewModel>(toastsViewModel);
            services.AddSingleton <BlocksViewModel>(blocksViewModel);
            services.AddSingleton <LatestBlockTransactionsViewModel>(latestBlockTransactionsViewModel);
            services.AddTransient <BlockTransactionsViewModel>();
            services.AddSingleton <AccountsViewModel>(accountsViewModel);
            services.AddSingleton <NewAccountPrivateKeyViewModel>(newAccountPrivateKeyViewModel);
            services.AddSingleton <SendTransactionViewModel>();
            services.AddSingleton <SendErc20TransactionViewModel>();
            services.AddSingleton(accountsTransactionMonitoringService);
            services.AddSingleton <TransactionWithReceiptViewModel>();

            services.AddFlexGrid(cfg =>
            {
                cfg.ApplyConfiguration(new TransactionsViewModelGridConfiguration());
            });

            services.AddSingleton <Web3UrlViewModel>();
            services.AddStorage();
        }
Exemplo n.º 6
0
        public AccountsView(IViewContext viewContext, AccountsViewModel accountsViewModel)
            : base(viewContext, accountsViewModel, DashboardModule.ModuleName)
        {
            InitializeComponent();

            DataContext = accountsViewModel;
        }
Exemplo n.º 7
0
        public List <AccountsViewModel> GetAccounts()
        {
            AppUser user = db.Users.Find(User.Identity.GetUserId());
            List <AccountsViewModel> allAccounts = new List <AccountsViewModel>();

            if (user.CheckingAccounts != null)
            {
                List <CheckingAccount> checkingAccounts = user.CheckingAccounts.ToList <CheckingAccount>();
                // get checkings
                foreach (var c in checkingAccounts)
                {
                    AccountsViewModel accountToAdd = new AccountsViewModel();
                    accountToAdd.AccountNum  = c.AccountNum;
                    accountToAdd.AccountName = c.AccountName;
                    accountToAdd.Balance     = c.Balance;
                    allAccounts.Add(accountToAdd);
                }
            }
            if (user.SavingAccounts != null)
            {
                List <SavingAccount> savingAccounts = user.SavingAccounts.ToList <SavingAccount>();
                // get savings
                foreach (var s in savingAccounts)
                {
                    AccountsViewModel accountToAdd = new AccountsViewModel();
                    accountToAdd.AccountNum  = s.AccountNum;
                    accountToAdd.AccountName = s.AccountName;
                    accountToAdd.Balance     = s.Balance;
                    allAccounts.Add(accountToAdd);
                }
            }
            return(allAccounts);
        }
        public ActionResult ViewAccounts()
        {
            _accountsViewModel = new AccountsViewModel();
            try
            {
                List <Account>      accounts      = _accountProcessor.GetAccounts();
                List <AccountModel> accountsModel = new List <AccountModel>();

                if (accounts != null && accounts.Any())
                {
                    accountsModel = BuildToAccountModel(accounts);
                }

                _accountsViewModel.Accounts = accountsModel;
                return(View("ViewAccounts", _accountsViewModel));
            }
            catch (CrmDataException ex)
            {
                _logger.Error(ex);
                throw new CrmDataException(ex);
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                return(ViewMensajeModel(_messageException, TipoMensajeEnum.Error));
            }
        }
Exemplo n.º 9
0
        public AccountsMapView(AccountsViewModel vm)
        {
            this.Title = "Map";
            this.Icon  = "map.png";

            this.BindingContext = vm;


            ViewModel.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Accounts")
                {
                    MakeMap();
                }
            };


            map = new Map()
            {
                IsShowingUser = true
            };

            MakeMap();
            var stack = new StackLayout {
                Spacing = 0
            };

            map.VerticalOptions = LayoutOptions.FillAndExpand;
            map.HeightRequest   = 100;
            map.WidthRequest    = 960;

            stack.Children.Add(map);
            Content = stack;
        }
Exemplo n.º 10
0
        public AccountListControl()
        {
            InitializeComponent();

            viewModel      = new AccountsViewModel();
            BindingContext = viewModel;
        }
Exemplo n.º 11
0
        public MainWindowViewModel()
        {
            var nethereumHostProvider = Locator.Current.GetService <NethereumHostProvider>();
            var accountService        = Locator.Current.GetService <AccountsService>();
            var currentAccountsTransactionsService = Locator.Current.GetService <CurrentAccountTransactionsService>();

            //Add an account to the account service so we have one already
            accountService.AddAccount(new Web3.Accounts.Account("0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7"));

            PrivateKeyLoaderViewModel            = new PrivateKeyLoaderViewModel(accountService);
            PrivateKeyLoaderViewModel.PrivateKey = "0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7";
            //Default the private key

            AccountViewModel         = new AccountViewModel(nethereumHostProvider);
            AccountsViewModel        = new AccountsViewModel(nethereumHostProvider, accountService);
            KeyStoreLoaderViewModel  = new KeyStoreLoaderViewModel(accountService);
            SendTransactionViewModel = new SendTransactionViewModel(nethereumHostProvider);
            TransactionsViewModel    = new TransactionsViewModel(nethereumHostProvider, currentAccountsTransactionsService);
            StandardTokenViewModel   = new StandardTokenViewModel(nethereumHostProvider);
            UrlSettingViewModel      = new UrlSettingViewModel(nethereumHostProvider);
            UrlSettingViewModel.Url  = "http://localhost:8545";
            //Default simple url

            //Default someone to send something
            SendTransactionViewModel.AddressTo = "0x243e72b69141f6af525a9a5fd939668ee9f2b354";

            HdWalletAccountLoaderViewModel = new HdWalletAccountLoaderViewModel(accountService);
            //Default some words
            HdWalletAccountLoaderViewModel.Words = "ripple scissors kick mammal hire column oak again sun offer wealth tomorrow wagon turn fatal";
        }
Exemplo n.º 12
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            _dataContext = (AccountsViewModel)App.ServiceProvider.GetService(typeof(AccountsViewModel));
            await _dataContext.Initialization();
        }
Exemplo n.º 13
0
        public AccountsPage()
        {
            InitializeComponent();

            _viewModel = new AccountsViewModel();

            BindingContext = _viewModel;
        }
Exemplo n.º 14
0
        /// <summary>
        /// Метод очищает поиск по всем клиентам
        /// </summary>
        public void ClearAllAccountsSearch()
        {
            AccountsViewModel accountsViewModelCash = ModelCash <AccountsViewModel> .GetViewModel(currentUser.Id, ALL_ACCS);

            accountsViewModelCash.AllAccountsSearchNameCash.AddOrReplace(currentUser.Id, default);
            accountsViewModelCash.AllAccountsSearchTypeCash.AddOrReplace(currentUser.Id, default);
            ModelCash <AccountsViewModel> .SetViewModel(currentUser.Id, ALL_ACCS, accountsViewModelCash);
        }
Exemplo n.º 15
0
 public Account()
 {
     InitializeComponent();
     acVM = new AccountsViewModel();
     gridUserList.ItemsSource = acVM.UserList;
     this.DataContext         = acVM;
     actions = new SerializationAccountActions();
 }
Exemplo n.º 16
0
 public AccountsPage()
 {
     InitializeComponent();
     _viewModel            = new AccountsViewModel();
     _viewModel.Removing  += OnRemoving;
     _viewModel.AddFailed += OnAddFailed;
     DataContext           = _viewModel;
 }
Exemplo n.º 17
0
        public async Task LoadPage()
        {
            var viewModel = new AccountsViewModel(Navigation);

            BindingContext = viewModel;

            var layout = new StackLayout();

            try
            {
                viewModel.Model = await App.ApiClient.GetBankAccountsAsync();
            }
            catch (Exception ex)
            {
                var page = new ContentPage();
                page.DisplayAlert("Error", ex.Message, "OK", "Cancel");
            }

            var cell = new DataTemplate(typeof(MenuTextCell));

            cell.SetBinding(ImageCell.ImageSourceProperty, new Binding("Status")
            {
                Converter = new BankAccountStatusIconConverter()
            });
            cell.SetBinding(TextCell.TextProperty, "BankAccountName");
            cell.SetBinding(TextCell.DetailProperty, "LastFour");

            var list = new ListView {
                ItemsSource = viewModel.Model, ItemTemplate = cell
            };

            list.ItemSelected += async(sender, e) =>
            {
                var selectedAccount = (BankAccount)e.SelectedItem;
                if (selectedAccount.Status == "Verified")
                {
                    return;
                }

                var verifyPage = new VerifyBankPage(selectedAccount.Id);
                await Navigation.PushAsync(verifyPage);
            };
            layout.Children.Add(list);

            var addButton = new DefaultButton
            {
                Text = "ADD ACCOUNT"
            };

            addButton.Clicked += async(sender, e) =>
            {
                await Navigation.PushModalAsync(new AddBankAccountPage());
            };

            layout.Children.Add(addButton);

            Content = layout;
        }
Exemplo n.º 18
0
        public ActionResult Index()
        {
            var viewModel = new AccountsViewModel
            {
                Accounts = _accountRepo.GetAllAccountsButAdmin()
            };

            return(View(viewModel));
        }
Exemplo n.º 19
0
        public App(string[] args = null, IFileProvider fileProvider = null)
        {
            var hostBuilder = MobileBlazorBindingsHost.CreateDefaultBuilder()
                              .ConfigureServices((hostContext, services) =>
            {
                // Adds web-specific services such as NavigationManager
                services.AddBlazorHybrid();

                // Register app-specific services
                //services.AddSingleton<CounterState>();

                var web3ServiceProvider                  = new Web3ProviderService();
                var accountsService                      = new AccountsService(web3ServiceProvider);
                var newBlockProcessingService            = new NewBlockProcessingService(web3ServiceProvider);
                var toastsViewModel                      = new ToastsViewModel();
                var blocksViewModel                      = new BlocksViewModel(newBlockProcessingService);
                var latestBlockTransactionsViewModel     = new LatestBlockTransactionsViewModel(web3ServiceProvider);
                var newAccountPrivateKeyViewModel        = new NewAccountPrivateKeyViewModel();
                var accountsViewModel                    = new AccountsViewModel(accountsService, newAccountPrivateKeyViewModel);
                var accountsTransactionMonitoringService = new AccountsTransactionMonitoringService(accountsService, web3ServiceProvider);

                services.AddSingleton <IWeb3ProviderService, Web3ProviderService>((x) => web3ServiceProvider);
                services.AddSingleton <IAccountsService, AccountsService>((x) => accountsService);
                services.AddSingleton <NewBlockProcessingService>(newBlockProcessingService);
                services.AddSingleton <ToastsViewModel>(toastsViewModel);
                services.AddSingleton <BlocksViewModel>(blocksViewModel);
                services.AddSingleton <LatestBlockTransactionsViewModel>(latestBlockTransactionsViewModel);
                services.AddTransient <BlockTransactionsViewModel>();
                services.AddSingleton <AccountsViewModel>(accountsViewModel);
                services.AddSingleton <NewAccountPrivateKeyViewModel>(newAccountPrivateKeyViewModel);
                services.AddSingleton <SendTransactionViewModel>();
                services.AddSingleton <SendErc20TransactionViewModel>();
                services.AddSingleton(accountsTransactionMonitoringService);
                services.AddSingleton <TransactionWithReceiptViewModel>();
                services.AddSingleton <Web3UrlViewModel>();

                services.AddFlexGrid(cfg =>
                {
                    cfg.ApplyConfiguration(new TransactionsViewModelGridConfiguration());
                });
            })
                              .UseWebRoot("wwwroot");

            if (fileProvider != null)
            {
                hostBuilder.UseStaticFiles(fileProvider);
            }
            else
            {
                hostBuilder.UseStaticFiles();
            }
            var host = hostBuilder.Build();

            MainPage = new ContentPage();
            NavigationPage.SetHasNavigationBar(MainPage, false);
            host.AddComponent <Main>(parent: MainPage);
        }
Exemplo n.º 20
0
        public void ManageAccounts()
        {
            AccountsViewModel vm     = new AccountsViewModel();
            AccountsManager   window = new AccountsManager();

            window.DataContext = vm;
            window.Owner       = mainWindow;
            window.ShowDialog();
        }
Exemplo n.º 21
0
        /// <summary>
        /// Ограничение списка всех клиентов по типу
        /// </summary>
        /// <param name="accountsToLimit"></param>
        private void LimitAllAccsBySearchType(ref List <Account> accountsToLimit, AccountsViewModel accountsViewModel)
        {
            string allAccountsSearchType = accountsViewModel.AllAccountsSearchTypeCash.GetValueOrDefault(currentUser.Id);

            if (!string.IsNullOrEmpty(allAccountsSearchType))
            {
                accountsToLimit = accountsToLimit.Where(n => n.AccountType.ToString() == allAccountsSearchType).ToList();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Метод устанавливает значения для поиска по клиентам основной организации пользователя
        /// </summary>
        /// <param name="accountsViewModel"></param>
        /// <returns></returns>
        public void SearchCurrentAccounts(AccountsViewModel accountsViewModel)
        {
            //viewsInfo.Reset(CURRENT_ACCS);
            AccountsViewModel accountsViewModelCash = ModelCash <AccountsViewModel> .GetViewModel(currentUser.Id, CURRENT_ACCS);

            accountsViewModelCash.CurrentAccountsSearchNameCash.AddOrReplace(currentUser.Id, accountsViewModel.CurrentAccountsSearchName?.ToLower().TrimStartAndEnd());
            accountsViewModelCash.CurrentAccountsSearchTypeCash.AddOrReplace(currentUser.Id, accountsViewModel.CurrentAccountsSearchType);
            ModelCash <AccountsViewModel> .SetViewModel(currentUser.Id, CURRENT_ACCS, accountsViewModelCash);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Ограничение списка всех клиентов по названию
        /// </summary>
        /// <param name="viewName"></param>
        /// <param name="accountsToLimit"></param>
        private void LimitAllAccsBySearchName(ref List <Account> accountsToLimit, AccountsViewModel accountsViewModel)
        {
            string allAccountsSearchName = accountsViewModel.AllAccountsSearchNameCash.GetValueOrDefault(currentUser.Id);

            if (!string.IsNullOrEmpty(allAccountsSearchName))
            {
                accountsToLimit = accountsToLimit.Where(n => n.Name.ToLower().Contains(allAccountsSearchName)).ToList();
            }
        }
Exemplo n.º 24
0
        public ActionResult Accounts()
        {
            AccountsViewModel acc = new AccountsViewModel();
            var user = db.Users.Where(m => m.UserName.Equals(User.Identity.Name)).FirstOrDefault();

            acc.Accounts        = db.Accounts.Where(m => m.UserId.Equals(user.Id)).ToList();
            acc.CreateAccountVM = new CreateAccountViewModel();

            return(View(acc));
        }
Exemplo n.º 25
0
 public ActionResult Save(AccountsViewModel model)
 {
     if (model.AccountId == 0)
     {
         var entity = MapToEntity(model);
         db.Account.Add(entity);
         db.SaveChanges();
     }
     return(Json(ConfirmationMessages.CreateSuccessConfirmation("Record Saved Successfully")));
 }
Exemplo n.º 26
0
        public AccountsController()
        {
            LogicFactory lf = new LogicFactory();

            this.accLogic         = lf.GetAccountLogic();
            this.mapper           = Models.MapperFactory.CreateMapper();
            this.vm               = new AccountsViewModel();
            vm.CurrentlyEdited    = new Account();
            vm.AccountsInDatabase = mapper.Map <IEnumerable <CarRental.Logic.DTO.Account>, IEnumerable <CarRental.Web.Models.Account> >(this.accLogic.GetAccountData());
        }
Exemplo n.º 27
0
 private MainViewModel()
 {
     Costs      = new ObservableCollection <CostViewModel>();
     Categories = new ObservableCollection <CategoryViewModel>();
     DbWorker   = DbWorker.Current;
     Accounts   = new AccountsViewModel();
     Diagram    = new DiagramViewModel();
     OneDrive   = new OneDriveViewModel();
     Donate     = new DonateViewModel();
 }
Exemplo n.º 28
0
        /// <summary>
        /// Метод ограничивает список клиентов основной организации пользователя
        /// </summary>
        /// <param name="accounts"></param>
        /// <returns></returns>
        private List <Account> GetLimitedCurrentAccountsList(List <Account> accounts)
        {
            List <Account>    limitedAccounts       = accounts.Where(orgId => orgId.OrganizationId == currentUser.PrimaryOrganizationId).ToList();
            AccountsViewModel accountsViewModelCash = ModelCash <AccountsViewModel> .GetViewModel(currentUser.Id, CURRENT_ACCS);

            LimitCurrentAccsBySearchName(ref limitedAccounts, accountsViewModelCash);
            LimitCurrentAccsBySearchType(ref limitedAccounts, accountsViewModelCash);
            LimitListByPageNumber(currentUser.Id, CURRENT_ACCS, ref limitedAccounts);
            return(limitedAccounts);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Метод ограничивает список клиентов всех организаций
        /// </summary>
        /// <param name="accounts"></param>
        /// <returns></returns>
        private List <Account> GetLimitedAllAccountsList(List <Account> accounts)
        {
            List <Account>    limitedAccounts       = accounts;
            AccountsViewModel accountsViewModelCash = ModelCash <AccountsViewModel> .GetViewModel(currentUser.Id, ALL_ACCS);

            LimitAllAccsBySearchName(ref limitedAccounts, accountsViewModelCash);
            LimitAllAccsBySearchType(ref limitedAccounts, accountsViewModelCash);
            LimitListByPageNumber(currentUser.Id, ALL_ACCS, ref limitedAccounts);
            return(limitedAccounts);
        }
Exemplo n.º 30
0
        public List <AccountsViewModel> GetListAccounts()
        {
            AppUser user = db.Users.Find(User.Identity.GetUserId());
            List <AccountsViewModel> allAccounts = new List <AccountsViewModel>();

            if (user.CheckingAccounts != null)
            {
                List <CheckingAccount> checkingAccounts = user.CheckingAccounts.ToList <CheckingAccount>();
                // get checkings
                foreach (var c in checkingAccounts)
                {
                    AccountsViewModel accountToAdd = new AccountsViewModel();
                    accountToAdd.AccountNum  = c.AccountNum;
                    accountToAdd.AccountName = c.AccountName;
                    accountToAdd.Balance     = c.Balance;
                    allAccounts.Add(accountToAdd);
                }
            }

            if (user.IRAccount != null)
            {
                IRAccount i = user.IRAccount;
                // get checkings
                AccountsViewModel accountToAdd = new AccountsViewModel();
                accountToAdd.AccountNum  = i.AccountNum;
                accountToAdd.AccountName = i.AccountName;
                accountToAdd.Balance     = i.Balance;
                allAccounts.Add(accountToAdd);
            }

            if (user.SavingAccounts != null)
            {
                List <SavingAccount> savingAccounts = user.SavingAccounts.ToList <SavingAccount>();
                // get savings
                foreach (var s in savingAccounts)
                {
                    AccountsViewModel accountToAdd = new AccountsViewModel();
                    accountToAdd.AccountNum  = s.AccountNum;
                    accountToAdd.AccountName = s.AccountName;
                    accountToAdd.Balance     = s.Balance;
                    allAccounts.Add(accountToAdd);
                }
            }
            if (user.StockPortfolio != null)
            {
                StockPortfolio stockPortfolio = user.StockPortfolio;
                // get cash portion stock portfolio
                AccountsViewModel p = new AccountsViewModel();
                p.AccountNum  = stockPortfolio.AccountNum;
                p.AccountName = stockPortfolio.AccountName;
                p.Balance     = stockPortfolio.Balance;
                allAccounts.Add(p);
            }
            return(allAccounts);
        }
Exemplo n.º 31
0
 private void deleteAccountButton(object sender, EventArgs e)
 {
     AccountsViewModel a = new AccountsViewModel();
     a.deleteAccount(currentAccount);
     NavigationService.GoBack();
 }