Beispiel #1
0
        /// <summary>
        /// SelectMemberHistories() method
        /// - Select MemberHistory table row by fromDate and toDate
        /// </summary>
        /// <param name="fromDate">From date</param>
        /// <param name="toDate">To date</param>
        /// <returns></returns>
        public List <MemberHistory> SelectMemberHistories(DateTime fromDate, DateTime toDate)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    return((List <MemberHistory>)MySqlDataHelperFactory.SelectMultipleEntities <MemberHistory>(connection,
                                                                                                               typeof(MemberHistory),
                                                                                                               CommandType.Text,
                                                                                                               @"SELECT Sequence, MemberID, MemberName, Successful, Message, InsertedDate " +
                                                                                                               @"FROM Product.MemberHistory " +
                                                                                                               @"WHERE InsertedDate >= @FromDate AND InsertedDate <= @ToDate " +
                                                                                                               @"ORDER BY InsertedDate DESC; ",
                                                                                                               MySqlParameterHelperFactory.CreateParameter(providerName, "@FromDate", fromDate, ParameterDirection.Input),
                                                                                                               MySqlParameterHelperFactory.CreateParameter(providerName, "@ToDate", toDate, ParameterDirection.Input)
                                                                                                               ));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// SelectMembers method
        /// - Select Member table rows by memberName
        /// </summary>
        /// <param name="memberName">Member name</param>
        /// <returns></returns>
        public List <Member> SelectMembers(string memberName)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    List <Member> ret = (List <Member>)MySqlDataHelperFactory.SelectMultipleEntities <Member>(connection,
                                                                                                              typeof(Member),
                                                                                                              CommandType.Text,
                                                                                                              @"SELECT MemberID, MemberName, IsAvailable, Email, PhoneNumber, Address, InsertedDate, UpdatedDate " +
                                                                                                              @"FROM Product.Member " +
                                                                                                              @"WHERE MemberName like @MemberName; ",
                                                                                                              MySqlParameterHelperFactory.CreateParameter(providerName, "@MemberName", String.Format("%{0}%", memberName), ParameterDirection.Input)
                                                                                                              );

                    return(ret);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
        /// <summary>
        /// SelectMemberHistories() method
        /// - Select MemberHistory table row by fromDate and toDate
        /// </summary>
        /// <param name="fromDate">From date</param>
        /// <param name="toDate">To date</param>
        /// <returns></returns>
        public List <MemberHistory> SelectMemberHistories(DateTime fromDate, DateTime toDate)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    return((List <MemberHistory>)MySqlDataHelperFactory.SelectMultipleEntities <MemberHistory>(connection,
                                                                                                               typeof(MemberHistory),
                                                                                                               CommandType.StoredProcedure,
                                                                                                               "Product.sp_Memberships_Select_MemberHistories_By_FromToDate",
                                                                                                               MySqlParameterHelperFactory.CreateParameter(providerName, "@FromDate", fromDate, ParameterDirection.Input),
                                                                                                               MySqlParameterHelperFactory.CreateParameter(providerName, "@ToDate", toDate, ParameterDirection.Input)
                                                                                                               ));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// SelectMembers method
        /// - Select Member table rows by memberName
        /// </summary>
        /// <param name="memberName">Member name</param>
        /// <returns></returns>
        public List <Member> SelectMembers(string memberName)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    List <Member> ret = (List <Member>)MySqlDataHelperFactory.SelectMultipleEntities <Member>(connection,
                                                                                                              typeof(Member),
                                                                                                              CommandType.StoredProcedure,
                                                                                                              "Product.sp_Memberships_Select_Members_By_MemberName",
                                                                                                              MySqlParameterHelperFactory.CreateParameter(providerName, "@MemName", String.Format("%{0}%", memberName), ParameterDirection.Input)
                                                                                                              );

                    return(ret);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }