Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        [Test] public void CreateAndSaveArtikel()
        {
            NewDb();

            Artikel mate = JetonCtrl.CreateArtikel();

            mate.Name      = "Mate";
            mate.Bestand   = 0;
            mate.Preis     = 1.50m;
            mate.ProKasten = 20;
            JetonCtrl.SaveArtikel(mate);

            Artikel fritz = JetonCtrl.CreateArtikel();

            fritz.Name      = "Fritz";
            fritz.Bestand   = 24;
            fritz.Preis     = 1.00m;
            fritz.ProKasten = 24;
            JetonCtrl.SaveArtikel(fritz);

            // There should be two articles
            List <Artikel> aList = JetonCtrl.GetArtikel();

            Assert.AreEqual(2, aList.Count);

            // There should be two articles
            List <Artikel> vaList = JetonCtrl.GetArtikel();

            Assert.AreEqual(2, vaList.Count);
        }
Exemple #2
0
        /// <summary>
        ///  Search and return all Artikel
        /// </summary>
        public static List <Artikel> GetArtikel()
        {
            List <Artikel> list  = new List <Artikel>();
            Artikel        proto = new Artikel();

            IObjectSet res = Db.Get(proto);

            foreach (Artikel a in res)
            {
                list.Add(a);
            }

            return(list);
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 public static void SaveArtikel(Artikel i)
 {
     Db.Set(i);
     Db.Commit();
 }