Пример #1
0
 /// <param name='operations'>
 /// Reference to the Api.Sdk.IBorrower.
 /// </param>
 /// <param name='borrowerId'>
 /// Required.
 /// </param>
 public static object DeleteByBorrowerid(this IBorrower operations, string borrowerId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IBorrower)s).DeleteByBorroweridAsync(borrowerId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #2
0
 /// <param name='operations'>
 /// Reference to the Api.Sdk.IBorrower.
 /// </param>
 /// <param name='borrower'>
 /// Required.
 /// </param>
 public static BorrowerDto PutByBorrower(this IBorrower operations, BorrowerDto borrower)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IBorrower)s).PutByBorrowerAsync(borrower);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #3
0
 /// <summary>
 /// Tworzy obiekt czytaj¹cy na podstawie dostarczonego zapytania SQL,
 /// wykonuje metodê BorrowReader dostarczonego obiektu IBorrower
 /// i zamyka obiekt czytaj¹cy.
 /// </summary>
 /// <param name="sql">Wykonywane zapytanie SQL.</param>
 /// <param name="borrower">Obiekt implementuj¹cy IBorrower.</param>
 /// <returns>Wartoœæ zwracana przez dostarczon¹ metodê.</returns>
 public static object LendReader2(string sql, IBorrower borrower)
 {
     using (OleDbConnection conn = DataServices.CreateConnection())
     {
         conn.Open();
         OleDbCommand    c = new OleDbCommand(sql, conn);
         OleDbDataReader r = c.ExecuteReader();
         return(borrower.BorrowReader(r));
     }
 }
Пример #4
0
        public async Task <BorrowerDto> Update(BorrowerDto borrowerDto)
        {
            IBorrower borrower = await BorrowerFactory.FetchAsync(borrowerDto.Id);

            borrower.Position           = borrowerDto.Position;
            borrower.EDisclosureConsent = borrowerDto.EDisclosureConsent;
            borrower.EmailConsent       = borrowerDto.EmailConsent;
            borrower.EmailAddress       = borrowerDto.EmailAddress;

            borrower = await borrower.SaveAsync() as IBorrower;

            return(new BorrowerDto
            {
                PartnerId = borrower.PartnerId,
                CobranderId = borrower.CobranderId,
                SiteProfileId = borrower.SiteProfileId,
                AccountId = borrower.AccountId,
                Id = borrower.Id,
                Position = borrower.Position,
                EDisclosureConsent = borrower.EDisclosureConsent,
                EmailConsent = borrower.EmailConsent,
                EmailAddress = borrower.EmailAddress
            });
        }
Пример #5
0
        public async Task <BorrowerDto> Insert(BorrowerDto borrowerDto)
        {
            IBorrower borrower = await BorrowerFactory.CreateAsync(new Tuple <Guid, Guid, Guid, Guid>(borrowerDto.PartnerId, borrowerDto.CobranderId, borrowerDto.SiteProfileId, borrowerDto.AccountId));

            borrower.Position           = borrowerDto.Position;
            borrower.EDisclosureConsent = borrowerDto.EDisclosureConsent;
            borrower.EmailConsent       = borrowerDto.EmailConsent;
            borrower.EmailAddress       = borrowerDto.EmailAddress;

            borrower = await borrower.SaveAsync() as IBorrower;

            return(new BorrowerDto
            {
                PartnerId = borrower.PartnerId,
                CobranderId = borrower.CobranderId,
                SiteProfileId = borrower.SiteProfileId,
                AccountId = borrower.AccountId,
                Id = borrower.Id,
                Position = borrower.Position,
                EDisclosureConsent = borrower.EDisclosureConsent,
                EmailConsent = borrower.EmailConsent,
                EmailAddress = borrower.EmailAddress
            });
        }
Пример #6
0
 public BorrowerController(IBorrower _IBorrower, IStatus _IStatus, DBContext _db)
 {
     _Borrower = _IBorrower;
     _Status   = _IStatus;
     db        = _db;
 }
Пример #7
0
 public ReturnBookContext(IBorrower borrower, Library library)
 {
     _borrower = borrower;
     _library = library;
 }
Пример #8
0
        /// <param name='operations'>
        /// Reference to the Api.Sdk.IBorrower.
        /// </param>
        /// <param name='borrowerId'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <BorrowerDto> GetByBorroweridAsync(this IBorrower operations, string borrowerId, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <Api.Sdk.Models.BorrowerDto> result = await operations.GetByBorroweridWithOperationResponseAsync(borrowerId, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the LendingRestClient class.
 /// </summary>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public LendingRestClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)
     : base(rootHandler, handlers)
 {
     this._borrower = new Borrower(this);
     this._baseUri  = new Uri("http://l2borrowerpoc.azurewebsites.net");
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the LendingRestClient class.
 /// </summary>
 public LendingRestClient()
     : base()
 {
     this._borrower = new Borrower(this);
     this._baseUri  = new Uri("http://l2borrowerpoc.azurewebsites.net");
 }
Пример #11
0
 public BorrowersController(IBorrower iBorrower)
 {
     this._IBorrower = iBorrower;
 }
Пример #12
0
        /// <param name='operations'>
        /// Reference to the Api.Sdk.IBorrower.
        /// </param>
        /// <param name='borrower'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <BorrowerDto> PostByBorrowerAsync(this IBorrower operations, BorrowerDto borrower, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <BorrowerDto> result = await operations.PostByBorrowerWithOperationResponseAsync(borrower, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Пример #13
0
 public BorrowBookContext(IBorrower borrower, Library library)
 {
     _borrower = borrower;
     _library  = library;
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the Lending20APIV1 class.
 /// </summary>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public Lending20APIV1(params DelegatingHandler[] handlers)
     : base(handlers)
 {
     this._borrower = new Borrower(this);
     this._baseUri  = new Uri("http://l2borrowerpoc.azurewebsites.net");
 }
Пример #15
0
 public LoanController(ILoan _ILoan, IBook _IBook, IBorrower _IBorrower)
 {
     _Loan     = _ILoan;
     _Book     = _IBook;
     _Borrower = _IBorrower;
 }