Ejemplo n.º 1
0
        public AccountSource Create(AccountSource newSource)
        {
            newSource = _accountSourceDbController.Create(newSource);

            _logger.LogInformation($"{newSource?.Id}");

            return(newSource);
        }
Ejemplo n.º 2
0
 public void Update(AccountSource source)
 {
     using (var context = ContextFactory.Create())
     {
         context.AccountSources.Update(source);
         context.SaveChanges();
     }
 }
        private AccountSource CreateAccountSource(string name)
        {
            var source = new AccountSource {
                Description      = name,
                Token            = name,
                RequiresPassword = true,
            };

            return(_accountSourceController.Create(source));
        }
Ejemplo n.º 4
0
        public AccountSource Create(AccountSource source)
        {
            using (var context = ContextFactory.Create())
            {
                context.AccountSources.Add(source);
                context.SaveChanges();

                return(source);
            }
        }
Ejemplo n.º 5
0
        protected override ObservableCollection <ResultCategoryViewModel> FilterResults()
        {
            var          filteredAccounts = AccountSource.Where(a => a.Name.StartsWith(SearchText, StringComparison.CurrentCultureIgnoreCase)).ToList();
            List <Payee> filteredPayees   = null;

            if (this.CellType == ColumnType.Transaction)
            {
                filteredPayees = PayeeSource.Where(p => p.Name.StartsWith(SearchText, StringComparison.CurrentCultureIgnoreCase)).ToList();
            }

            return(new ObservableCollection <ResultCategoryViewModel>(ConvertToResultCategories(filteredAccounts, filteredPayees)));
        }
Ejemplo n.º 6
0
            public override void Execute()
            {
                Console.WriteLine("\n-Authenticate-\n");

                Console.WriteLine("Enter username: "******"Enter password: "******"Account found: {account.Username}: \nPriviledges: {string.Join(", ", account.Priviledges)}.");

                    break;

                case AuthenticationStatus.InvalidCredentials:

                    InvalidCredentialsResult invalidCredentials = result as InvalidCredentialsResult;

                    Console.WriteLine($"Wrong password for {invalidCredentials.FormalIdentifier}.");

                    break;

                case AuthenticationStatus.NotFound:

                    Console.WriteLine("Account not found.");

                    break;

                default: Console.WriteLine("Unexpected code block reached (!!).");

                    break;
                }
            }
        public static AccountSourceResponse ToContract(this AccountSource sourceModel)
        {
            if (sourceModel == null)
            {
                return(null);
            }

            return(new AccountSourceResponse {
                Id = sourceModel.Id,
                Description = sourceModel.Description,
                Token = sourceModel.Token,
                RequiresPassword = sourceModel.RequiresPassword,
                AutoRegister = sourceModel.AutoRegister
            });
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var accountSource = new AccountSource(this);

            tableView.Source = accountSource;

            var sdc = searchDisplayController;

            sdc.SearchResultsSource = accountSource;
            sdc.SearchResultsTableView.RowHeight = tableView.RowHeight;
            sdc.SearchBar.TextChanged           += (sender, e) =>
            {
                string text = e.SearchText.ToLower();
                _filteredAccounts = _accounts.Where(ac => ac.Name.ToLower().Contains(text)).ToList();
            };
            // Perform any additional setup after loading the view, typically from a nib.
        }
Ejemplo n.º 9
0
        protected override void ProcessRecord()
        {
            try
            {
                DevAccountSource accountType = DevAccountSource.UniversalDeveloperCenter;
                if (AccountSource.Equals("XboxDeveloperPortal", StringComparison.OrdinalIgnoreCase) || AccountSource.Equals("XDP", StringComparison.OrdinalIgnoreCase))
                {
                    accountType = DevAccountSource.XboxDeveloperPortal;
                }
                DevAccount account = Microsoft.Xbox.Services.Tool.Auth.SignIn(accountType, UserName).Result;

                WriteObject(account);
            }
            catch (AggregateException e)
            {
                var innerEx = e.InnerException;
                WriteError(new ErrorRecord(innerEx, "Set-XBLDevUdcAccount failed", ErrorCategory.SecurityError, null));
            }
        }
        private static Account CreateAccount(SUGARContext context, string name, string password, AccountSource source, User user)
        {
            var account = context.Accounts.Add(new Account
            {
                Name          = name,
                Password      = password,
                AccountSource = source,
                User          = user
            }).Entity;

            context.SaveChanges();
            return(account);
        }
Ejemplo n.º 11
0
        public void Update(AccountSource source)
        {
            _accountSourceDbController.Update(source);

            _logger.LogInformation($"{source?.Id}");
        }