Ejemplo n.º 1
0
        public ProductConfigures GetsByString(string sString)
        {
            ProductConfigures oProductConfigures = new ProductConfigures();

            try
            {
                SqlCommand cmd = new SqlCommand("SP_ProductConfigure_GetsByString", _conn);

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@PCID", SqlDbType.VarChar)).Value = sString;
                if (_conn.State == ConnectionState.Open)
                {
                }
                else
                {
                    cmd.Connection.Open();
                }
                IDataReader reader = cmd.ExecuteReader();

                oProductConfigures = CreateObjects(reader);
                reader.Close();
                cmd.Dispose();
                cmd.Connection.Close();
            }
            catch (Exception e)
            {
                throw new ServiceException(e.Message, e);
            }
            return(oProductConfigures);
        }
Ejemplo n.º 2
0
        public ProductConfigures Gets()
        {
            ProductConfigures oProductConfigures = new ProductConfigures();

            try
            {
                SqlCommand cmd = new SqlCommand("SP_ProductConfigure_Gets", _conn);

                cmd.CommandType = CommandType.StoredProcedure;
                if (_conn.State == ConnectionState.Open)
                {
                }
                else
                {
                    cmd.Connection.Open();
                }
                IDataReader reader = cmd.ExecuteReader();

                oProductConfigures = CreateObjects(reader);
                reader.Close();
                cmd.Dispose();
                cmd.Connection.Close();
            }
            catch (Exception e)
            {
                throw new ServiceException(e.Message, e);
            }
            return(oProductConfigures);
        }
Ejemplo n.º 3
0
        private ProductConfigures CreateObjects(IDataReader oReader)
        {
            ProductConfigures oProductConfigures = new ProductConfigures();
            NullHandler       oHandler           = new NullHandler(oReader);

            while (oReader.Read())
            {
                ProductConfigure oItem = CreateObject(oHandler);
                oProductConfigures.Add(oItem);
            }
            return(oProductConfigures);
        }