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); } }
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); } }
public List <Product> GetAll() { var queryString = String.Format("SELECT * FROM {0};", c_productsDatabaseName); return(m_productMapper.GetEntityList(queryString)); }
public List <Catalog> GetAll() { var queryString = String.Format("SELECT * FROM {0};", c_catalogsDatabaseName); return(m_catalogMapper.GetEntityList(queryString)); }
public List <User> GetAll() { var queryString = String.Format("SELECT * FROM {0};", c_usersDatabaseName); return(m_userMapper.GetEntityList(queryString)); }