Ejemplo n.º 1
0
        public async Task <User> GetByNicknameAsync(string nickname)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_nickname", DbType.String, nickname)
                             .Parameters;

            User user = default(User);

            await this.ExecuteReaderAsync("sp_GetUserByNickname", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref user, this.FormatUser));

            return(user);
        }
        public async Task <IList <Transaction> > SearchBusinessTransactionByUserAsync(long userId)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_user_id", DbType.Int64, userId)
                             .Parameters;

            IList <Transaction> list = new List <Transaction>();

            await this.ExecuteReaderAsync("sp_SearchBusinessTransactionsByUser", CommandType.StoredProcedure, parameters, (reader) => this.MapEntities(reader, ref list, this.FormatTransaction));

            return(list);
        }
Ejemplo n.º 3
0
        public virtual async Task <Account> GetAccountAsync(long accountId)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_account_id", DbType.Int64, accountId)
                             .Parameters;

            Account business = default(Account);

            await this.ExecuteReaderAsync("sp_GetAccount", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref business, this.FormatAccount));

            return(business);
        }
        public async Task <Transaction> GetTransactionAsync(long?transactionId)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_id", DbType.Int64, transactionId)
                             .Parameters;

            Transaction transaction = default(Transaction);

            await this.ExecuteReaderAsync("sp_GetTransaction", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref transaction, this.FormatTransaction));

            return(transaction);
        }
        public async Task <IList <Transaction> > GetTransactionsByAccount(Account account)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_account_id", DbType.Int64, account.Id)
                             .Parameters;

            IList <Transaction> list = new List <Transaction>();

            await this.ExecuteReaderAsync("sp_GetTransactionsByAccount", CommandType.StoredProcedure, parameters, (reader) => this.MapEntities(reader, ref list, this.FormatTransaction));

            return(list);
        }
        public virtual async Task <IList <Business> > GetBusinessByIdAsync(long id)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_user_id", DbType.Int64, id)
                             .Parameters;

            IList <Business> list = new List <Business>();

            await this.ExecuteReaderAsync("sp_GetBusinessByUserId", CommandType.StoredProcedure, parameters, (reader) => this.MapEntities(reader, ref list, this.FormatBusiness));

            return(list);
        }
        public virtual async Task <Business> GetBusinessAsync(long businessId)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_businessId", DbType.Int64, businessId)
                             .Parameters;

            Business business = default(Business);

            await this.ExecuteReaderAsync("sp_GetBusiness", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref business, this.FormatBusiness));

            return(business);
        }
        public virtual async Task <IList <Business> > SearchBusinessAsync(string name)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@piv_name", DbType.String, name)
                             .Parameters;

            IList <Business> list = new List <Business>();

            await this.ExecuteReaderAsync("sp_SearchBusiness", CommandType.StoredProcedure, parameters, (reader) => this.MapEntities(reader, ref list, this.FormatBusiness));

            return(list);
        }
Ejemplo n.º 9
0
        private async Task <User> GetUserAsync(string email, long?userId)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_email", DbType.String, email)
                             .AddInParameter("@p_user_id", DbType.Int64, userId)
                             .Parameters;

            User user = default(User);

            await this.ExecuteReaderAsync("sp_GetUser", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref user, this.FormatUser));

            return(user);
        }
Ejemplo n.º 10
0
        public async Task <User> LoginUserAsync(string email, string password)
        {
            var parameters = DataParameterBuilder.Create(this.GetFactory())
                             .AddInParameter("@p_email", DbType.String, email)
                             .AddInParameter("@p_password", DbType.String, password)
                             .Parameters;

            User user = default(User);

            await this.ExecuteReaderAsync("sp_LoginUser", CommandType.StoredProcedure, parameters, (reader) => this.MapEntity(reader, ref user, this.FormatUser));

            return(user);
        }