예제 #1
0
        public Item GetItemByID(int id)
        {
            Item item = new Item();
            DataTable dTable = new DataTable();
            ItemDAL iDAL = new ItemDAL();
            string cmd;

            cmd = "SELECT * FROM LOLBG.Items WHERE IsDeleted = 0 AND ID = " + id.ToString();
            dTable = iDAL.GetSqlQueryResults(cmd);
            item = AutoMapper.Mapper.Map<IDataReader, List<Item>>(dTable.CreateDataReader()).First();

            return item;
        }
예제 #2
0
        public List<Item> GetAllItems()
        {
            List<Item> itemList = new List<Item>();
            DataTable dTable = new DataTable();
            ItemDAL iDAL = new ItemDAL();
            string cmd;

            cmd = "SELECT * FROM LOLBG.Items WHERE IsDeleted = 0";
            dTable = iDAL.GetSqlQueryResults(cmd);
            itemList = AutoMapper.Mapper.Map<IDataReader, List<Item>>(dTable.CreateDataReader());

            return itemList;
        }