Esempio n. 1
0
        public OrderItem GetByCompoundId(int id1, int id2)
        {
            var queryString =
                String.Format("SELECT * FROM {0} LEFT JOIN {1} ON {0}.ProductId = {1}.Id WHERE OrderId = {2} AND ProductId = {3};",
                              c_orderItemsDatabaseName,
                              c_productsDatabaseName,
                              id1,
                              id2);

            try
            {
                var orderItem = m_orderItemMapper.GetEntityList(queryString).First();
                return(orderItem);
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                return(null);
            }
        }
Esempio n. 2
0
        public Order GetById(int id)
        {
            var queryString =
                String.Format("SELECT * FROM {0} LEFT JOIN {1} ON {0}.Id = {1}.OrderId LEFT JOIN {2} ON {1}.ProductId = {2}.Id WHERE UserId = {3};",
                              c_ordersDatabaseName,
                              c_orderItemsDatabaseName,
                              c_productsDatabaseName,
                              id);

            try
            {
                var order = m_orderMapper.GetEntityList(queryString).First();
                return(order);
            }

            catch (Exception ex)
            {
                logger.Error(ex.Message);
                return(null);
            }
        }
Esempio n. 3
0
        public List <Product> GetAll()
        {
            var queryString = String.Format("SELECT * FROM {0};", c_productsDatabaseName);

            return(m_productMapper.GetEntityList(queryString));
        }
Esempio n. 4
0
        public List <Catalog> GetAll()
        {
            var queryString = String.Format("SELECT * FROM {0};", c_catalogsDatabaseName);

            return(m_catalogMapper.GetEntityList(queryString));
        }
Esempio n. 5
0
        public List <User> GetAll()
        {
            var queryString = String.Format("SELECT * FROM {0};", c_usersDatabaseName);

            return(m_userMapper.GetEntityList(queryString));
        }