public void TestAddItemToStoreRepo()
        {
            StoreItemRepository storeRepos = new StoreItemRepository();

            storeRepos.Open();
            storeRepos.Add(book1);
            storeRepos.Add(book2);
            storeRepos.Close();
            storeRepos.Open();
            storeRepos.Add(book3);
        }
        public void TestRemoveItem()
        {
            StoreItemRepository     storeRepos = new StoreItemRepository();
            List <StoreItem>        list;
            IEnumerable <StoreItem> outItems;

            storeRepos.Open();
            list = storeRepos.GetAll().ToList();
            for (int i = 0; i < list.Count; i++)
            {
                Debug.WriteLine(list[i].Name);
            }
            Debug.WriteLine(list.Count);

            storeRepos.RemoveBy((i) => i.Name.ToLower().Contains("The"), out outItems);

            foreach (var item in outItems)
            {
                Debug.WriteLine(item.Name);
            }

            Debug.WriteLine(list.Count);

            storeRepos.Close();
        }
 private void User_LoggedIn(object sender, UserLoggedInEventArgs args)
 {
     currentUser = args.Worker;
     try
     {
         storeItems.Open();
     }catch (RepositoryOpenFailedExceptiom e)
     {
         log.Exception(e, "Failed on user login.");
         log.Fetal("Fetal Error, App shuting down.");
         Shutdown(1);
     }
 }
        public void TestGetItemList()
        {
            StoreItemRepository storeRepos = new StoreItemRepository();
            List <StoreItem>    list;

            storeRepos.Open();
            list = storeRepos.GetAll().ToList();
            for (int i = 0; i < list.Count; i++)
            {
                Debug.WriteLine(list[i].Name);
            }
            Debug.WriteLine(list.Count);
            storeRepos.Close();
        }