/// <summary>
        /// SelectNumsOfMembers method
        /// - Select number of Member table rows by memberName
        /// </summary>
        /// <param name="memberName"></param>
        /// <returns></returns>
        public int SelectNumsOfMembers(string memberName)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    OracleParameter resultPrameter = (OracleParameter)OracleParameterHelperFactory.CreateParameter <OracleDbType>(providerName, ":OutputData", null, OracleDbType.Int32, ParameterDirection.Output);

                    int notResult = Convert.ToInt32(OracleDataHelperFactory.SelectScalar(connection,
                                                                                         CommandType.StoredProcedure,
                                                                                         "Product.sp_Num_Of_Member_By_MemName",
                                                                                         OracleParameterHelperFactory.CreateParameter(providerName, ":MemName", String.Format("%{0}%", memberName), ParameterDirection.Input),
                                                                                         resultPrameter
                                                                                         ));

                    int ret = Convert.ToInt32(Convert.ToString(resultPrameter.Value));
                    return(ret);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        /// <summary>
        /// SelectNumsOfMembers method
        /// - Select number of Member table rows by memberName
        /// </summary>
        /// <param name="memberName"></param>
        /// <returns></returns>
        public int SelectNumsOfMembers(string memberName)
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    int ret = Convert.ToInt32(
                        OracleDataHelperFactory.SelectScalar(connection,
                                                             CommandType.Text,
                                                             @"SELECT COUNT(*) " +
                                                             @"FROM Product.Member " +
                                                             @"WHERE MemberName LIKE '%" + memberName + "%' "
                                                             )
                        );

                    return(ret);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
        /// <summary>
        /// SelectInsertedMemberID method
        /// - Select recently inserted MemberID
        /// </summary>
        /// <returns></returns>
        public int SelectInsertedMemberID()
        {
            try
            {
                using (connection)
                {
                    connection.Open();

                    int ret = Convert.ToInt32(
                        OracleDataHelperFactory.SelectScalar(connection,
                                                             CommandType.Text,
                                                             @"SELECT Product.SEQ_Member.CURRVAL FROM DUAL"
                                                             )
                        );

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