Beispiel #1
0
 /// <summary>
 /// Add new entity to accounts
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// New entity
 /// </param>
 /// <param name='prefer'>
 /// Required in order for the service to return a JSON representation of the
 /// object.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task<MicrosoftDynamicsCRMaccount> CreateAsync(this IAccounts operations, MicrosoftDynamicsCRMaccount body, string prefer = "return=representation", CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(body, prefer, null, cancellationToken).ConfigureAwait(false))
     {
         return _result.Body;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Get entities from accounts
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// </param>
 /// <param name='skip'>
 /// </param>
 /// <param name='search'>
 /// </param>
 /// <param name='filter'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='orderby'>
 /// Order items by property values
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task<AccountsGetResponseModel> GetAsync(this IAccounts operations, int? top = default(int?), int? skip = default(int?), string search = default(string), string filter = default(string), bool? count = default(bool?), IList<string> orderby = default(IList<string>), IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(top, skip, search, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return _result.Body;
     }
 }
Beispiel #3
0
 /// <summary>
 /// Get entity from accounts by key
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='accountid'>
 /// key: accountid
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task<MicrosoftDynamicsCRMaccount> GetByKeyAsync(this IAccounts operations, string accountid, IList<string> select = default(IList<string>), IList<string> expand = default(IList<string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetByKeyWithHttpMessagesAsync(accountid, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return _result.Body;
     }
 }
        public Dictionary <string, string>?Validate(IAccounts translation)
        {
            var errors = new Dictionary <string, string>();

            if (string.IsNullOrWhiteSpace(Name))
            {
                errors.Add(nameof(Name), translation.ValidationRequired);
            }

            if (string.IsNullOrWhiteSpace(Info))
            {
                errors.Add(nameof(Info), translation.ValidationRequired);
            }

            if (CurrencyId <= 0)
            {
                errors.Add(nameof(CurrencyId), translation.ValidationRequired);
            }

            if (IssuerId <= 0)
            {
                errors.Add(nameof(IssuerId), translation.ValidationRequired);
            }


            if (errors.Any())
            {
                return(errors);
            }

            return(null);
        }
 /// <summary>
 /// Initiates a forgotten password request for a user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='loginRequest'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LoginResponse> PostForgotPasswordAsync(this IAccounts operations, AccountLoginRequest loginRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PostForgotPasswordWithHttpMessagesAsync(loginRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create a new user account within the indicated client.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='account'>
 /// Details of account to create
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <string> PostCreateAccountAsync(this IAccounts operations, string client, PublicAccount account, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PostCreateAccountWithHttpMessagesAsync(client, account, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieve the collection of built-in and custom roles for the client.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RoleCollection> GetRetrieveRolesAsync(this IAccounts operations, string client, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetRetrieveRolesWithHttpMessagesAsync(client, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Use to login a user, and retrieve the appropriate security token
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='loginRequest'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <string> PutAccountLoginAsync(this IAccounts operations, LoginRequest loginRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PutAccountLoginWithHttpMessagesAsync(loginRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #9
0
 public AccountsController(IAccounts appService
                           , NewApplication5DbContext dbContext
                           )
 {
     _appService = appService ?? throw new ArgumentNullException(nameof(appService));
     _dbContext  = dbContext;
 }
 /// <summary>
 /// Search for Users based on the users Name, Username, Identifier, Email,
 /// Phone and RoleName.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='terms'>
 /// The terms to search the users with.
 /// </param>
 /// <param name='skip'>
 /// The number of users to skip at the begining of the list.
 /// </param>
 /// <param name='take'>
 /// The number of users to return.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PagePublicAccount> GetSearchAsync(this IAccounts operations, string client, string terms = default(string), int?skip = default(int?), int?take = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetSearchWithHttpMessagesAsync(client, terms, skip, take, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Refreshes the expiration on a security token, this should be called
 /// periodically (recommend, once per session).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <string> AccountPatchLoginAsync(this IAccounts operations, string client, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AccountPatchLoginWithHttpMessagesAsync(client, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #12
0
        public MsPresTU(IAccounts accounts, IUserz userz, LocationService locationService)
        {
            this.accounts         = accounts;
            this.userz            = userz;
            this.locationService  = locationService;
            this.enhancedPresence = new EnhancedPresence1(BenotifyHandler);
            this.dialogManager    = new DialogManager();

            locationService.AorAdded       += LocationService_AorAdded;
            locationService.AorRemoved     += LocationService_AorRemoved;
            locationService.ContactAdded   += LocationService_ContactAdded;
            locationService.ContactRemoved += LocationService_ContactRemoved;

            userz.Updated += Users_AddedOrUpdated;
            userz.Added   += Users_AddedOrUpdated;
            userz.Reset   += Users_Reset;

            accounts.ForEach((account) =>
            {
                for (int i = 0; i < userz.Count; i++)
                {
                    ResetUsers(userz[i], account);
                }
            });
        }
Beispiel #13
0
 /// <summary>
 /// Get entities from accounts
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// </param>
 /// <param name='filter'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='orderby'>
 /// Order items by property values
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftDynamicsCRMaccountCollection> GetAsync(this IAccounts operations, int?top = default(int?), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(top, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Updates an account
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id of the account
 /// </param>
 /// <param name='dto'>
 /// New account value
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <object> PatchByiddtoAsync(this IAccounts operations, int id, WriteAccountDto dto, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.PatchByiddtoWithHttpMessagesAsync(id, dto, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
		public DirectorySearchTU(IAccounts accounts, ServiceSoap1 serviceSoap, IUserz userz)
		{
			this.type = new ByteArrayPart("application");
			this.subtype = new ByteArrayPart("SOAP+xml");
			this.accounts = accounts;
			this.serviceSoap = serviceSoap;
			this.userz = userz;
		}
 public DirectorySearchTU(IAccounts accounts, ServiceSoap1 serviceSoap, IUserz userz)
 {
     this.type        = new ByteArrayPart("application");
     this.subtype     = new ByteArrayPart("SOAP+xml");
     this.accounts    = accounts;
     this.serviceSoap = serviceSoap;
     this.userz       = userz;
 }
        public DigestAuthentication(IAccounts accounts, IUserz userz, bool isAuthIntEnabled)
        {
            this.accounts         = accounts;
            this.userz            = userz;
            this.isAuthIntEnabled = isAuthIntEnabled;

            authStates = new ThreadSafe.Dictionary <int, AuthState>(new Dictionary <int, AuthState>(16384));           // vf Int32Compa...
            timer      = new Timer(RemoveExpiredNonce, null, 0, NonceLifeCheckInterval);
        }
        public SipMicrosoftAuthentication(AuthSchemes scheme, IAccounts accounts, IUserz userz)
        {
            this.scheme   = scheme;
            this.accounts = accounts;
            this.userz    = userz;

            this.connectingAssociations = new ThreadSafe.Dictionary <int, SecurityAssociation>(new Dictionary <int, SecurityAssociation>());

            this.timer      = new Timer(RemoveExpiredSecurityAssociationsTimer, null, 0, 60 * 1000);
            this.credHandle = Sspi.SafeAcquireCredentialsHandle(scheme.ToString(), CredentialUse.SECPKG_CRED_BOTH);
        }
Beispiel #19
0
        public AccountsPresenter(IAccounts view, CustomerPresenter customerPresenter)
        {
            Console.WriteLine("AccountsPresenter Constructor");
            _view = view;
            _customerPresenter = customerPresenter;

            _view.OnCreateAccount += CreateAccount;
            _view.OnInsert        += InsertTransaction;
            _customerPresenter.CallGetTransactions += GetTransactions;
            _customerPresenter.CallShowAccounts    += ShowAccounts;
            _customerPresenter.CallClearAccounts   += ClearAccounts;
        }
Beispiel #20
0
        public ProxyServerTU(ILocationService locationService, ITrunkManager trunkManager, int delayTimerC, IAccounts accounts)
        {
            this.IsOfficeSIPFiletransferEnabled = true;

            this.locationService = locationService;
            this.trunkManager    = trunkManager;
            this.accounts        = accounts;

            this.requestProducer = new ProducedRequest(this)
            {
                IncomingResponse = ProccessResponse,
                TransportError   = ProccessTransportError,
                ProduceAck       = ProduceAck,
            };

            this.clientTransactionIds = new ThreadSafe.Dictionary <int, int>(new Dictionary <int, int>(16384 * 3));
            this.requestProxyes       = new ThreadSafe.Dictionary <int, RequestProxy>(new Dictionary <int, RequestProxy>(16384));

            this.timerC = new MultiTimerEx <ServerClientId>(TimerC, 16384, delayTimerC);
        }
        public AccountsTest()
        {
            // Create instances to mocked all dependencies
            FMockDbContext = new Mock <MainDbContext>();

            // Upload pre-fixed dummy data
            var LCountriesDbSet = DummyLoad.ReturnDummyCountries().AsQueryable().BuildMockDbSet();
            var LCitiesDbSet    = DummyLoad.ReturnDummyCities().AsQueryable().BuildMockDbSet();
            var LUsersDbSet     = DummyLoad.ReturnDummyUsers().AsQueryable().BuildMockDbSet();
            var LSigninHistory  = DummyLoad.ReturnSigninHistory().AsQueryable().BuildMockDbSet();

            // Populate database tables with dummy data
            FMockDbContext.Setup(AMainDbContext => AMainDbContext.Countries).Returns(LCountriesDbSet.Object);
            FMockDbContext.Setup(AMainDbContext => AMainDbContext.Cities).Returns(LCitiesDbSet.Object);
            FMockDbContext.Setup(AMainDbContext => AMainDbContext.Users).Returns(LUsersDbSet.Object);
            FMockDbContext.Setup(AMainDbContext => AMainDbContext.SigninHistory).Returns(LSigninHistory.Object);

            // Create test instance with mocked dependencies
            FAccounts = new Accounts(FMockDbContext.Object);
        }
Beispiel #22
0
		public MsPresTU(IAccounts accounts, IUserz userz, LocationService locationService)
		{
			this.accounts = accounts;
			this.userz = userz;
			this.locationService = locationService;
			this.enhancedPresence = new EnhancedPresence1(BenotifyHandler);
			this.dialogManager = new DialogManager();

			locationService.AorAdded += LocationService_AorAdded;
			locationService.AorRemoved += LocationService_AorRemoved;
			locationService.ContactAdded += LocationService_ContactAdded;
			locationService.ContactRemoved += LocationService_ContactRemoved;

			userz.Updated += Users_AddedOrUpdated;
			userz.Added += Users_AddedOrUpdated;
			userz.Reset += Users_Reset;

			accounts.ForEach((account) =>
			{
				for (int i = 0; i < userz.Count; i++)
					ResetUsers(userz[i], account);
			});
		}
 /// <summary>
 /// Search for Users based on the users Name, Username, Identifier, Email,
 /// Phone and RoleName.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='terms'>
 /// The terms to search the users with.
 /// </param>
 /// <param name='skip'>
 /// The number of users to skip at the begining of the list.
 /// </param>
 /// <param name='take'>
 /// The number of users to return.
 /// </param>
 public static PagePublicAccount GetSearch(this IAccounts operations, string client, string terms = default(string), int?skip = default(int?), int?take = default(int?))
 {
     return(operations.GetSearchAsync(client, terms, skip, take).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Change the list of custom roles for the client, built-in roles are ignored.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostUpdateRolesAsync(this IAccounts operations, string client, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PostUpdateRolesWithHttpMessagesAsync(client, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Change the list of custom roles for the client, built-in roles are ignored.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// </param>
 public static void PostUpdateRoles(this IAccounts operations, string client)
 {
     operations.PostUpdateRolesAsync(client).GetAwaiter().GetResult();
 }
Beispiel #26
0
		public RegistrarTU(LocationService locationService, IAccounts accounts)
		{
			this.locationService = locationService;
			this.accounts = accounts;
		}
 /// <summary>
 /// Retrieve the collection of built-in and custom roles for the client.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// </param>
 public static RoleCollection GetRetrieveRoles(this IAccounts operations, string client)
 {
     return(operations.GetRetrieveRolesAsync(client).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Resets the password for the currently logged in user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='id'>
 /// Id for the account
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostResetPasswordAsync(this IAccounts operations, string client, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PostResetPasswordWithHttpMessagesAsync(client, id, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
		public DigestAuthentication(IAccounts accounts, IUserz userz, bool isAuthIntEnabled)
		{
			this.accounts = accounts;
			this.userz = userz;
			this.isAuthIntEnabled = isAuthIntEnabled;

			authStates = new ThreadSafe.Dictionary<int, AuthState>(new Dictionary<int, AuthState>(16384)); // vf Int32Compa...
			timer = new Timer(RemoveExpiredNonce, null, 0, NonceLifeCheckInterval);
		}
 /// <summary>
 /// Changes the password for the currently logged in user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='id'>
 /// Id for the account
 /// </param>
 /// <param name='request'>
 /// Confirmation password and new password
 /// </param>
 public static void PostChangePassword(this IAccounts operations, string client, string id, AccountPasswordChangeRequest request)
 {
     operations.PostChangePasswordAsync(client, id, request).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Performs a soft-delete of the indicated account.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='id'>
 /// Id for the account
 /// </param>
 public static void DeleteAccount(this IAccounts operations, string client, string id)
 {
     operations.DeleteAccountAsync(client, id).GetAwaiter().GetResult();
 }
Beispiel #32
0
 public void AddAccount(IAccounts account)
 {
     this.accounts.Add(account);
 }
Beispiel #33
0
 public void RemoveAccount(IAccounts account)
 {
     this.accounts.Remove(account);
 }
 // OpenRasta will inject these dependancies
 public AccountHandler(IAccounts accounts)
 {
     _accounts = accounts;
 }
Beispiel #35
0
 public IndexController(IAccounts Account)
 {
     AccCreater = Account;
 }
 /// <summary>
 /// Refreshes the expiration on a security token, this should be called
 /// periodically (recommend, once per session).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 public static string AccountPatchLogin(this IAccounts operations, string client)
 {
     return(operations.AccountPatchLoginAsync(client).GetAwaiter().GetResult());
 }
		public ResourceListsHandler(IAccounts accounts, IUserz userz)
		{
			this.accounts = accounts;
			this.userz = userz;
		}
 /// <summary>
 /// Initiates a forgotten password request for a user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='loginRequest'>
 /// </param>
 public static LoginResponse PostForgotPassword(this IAccounts operations, AccountLoginRequest loginRequest)
 {
     return(operations.PostForgotPasswordAsync(loginRequest).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Resets the password for the currently logged in user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='client'>
 /// Client short name
 /// </param>
 /// <param name='id'>
 /// Id for the account
 /// </param>
 public static void PostResetPassword(this IAccounts operations, string client, string id)
 {
     operations.PostResetPasswordAsync(client, id).GetAwaiter().GetResult();
 }