Beispiel #1
0
        public void Delete(Game g)
        {
            p = new PGame();
            List <Game> del = p.Open();

            for (int i = 0; i < del.Count; i++)
            {
                if (del[i].GetID() == g.GetID())
                {
                    del.RemoveAt(i);
                    break;
                }
            }
            p.Save(del);
        }
Beispiel #2
0
        public void Delete(Game c)
        {
            PGame       p  = new PGame();
            List <Game> cs = p.Open();

            for (int i = 0; i < cs.Count; i++)
            {
                if (cs[i].Id == c.Id)
                {
                    cs.RemoveAt(i);
                    break;
                }
            }
            p.Save(cs);
        }
Beispiel #3
0
        public void Update(Game g)
        {
            p = new PGame();
            List <Game> up = p.Open();

            for (int i = 0; i < up.Count; i++)
            {
                if (up[i].GetID() == g.GetID())
                {
                    up.RemoveAt(i);
                    break;
                }
            }
            up.Add(g);
            p.Save(up);
        }
Beispiel #4
0
        public void Update(MGame c)
        {
            PGame        p  = new PGame();
            List <MGame> cs = p.Open();

            for (int i = 0; i < cs.Count; i++)
            {
                if (cs[i].Id == c.Id)
                {
                    cs.RemoveAt(i);
                    break;
                }
            }
            cs.Add(c);
            p.Save(cs);
        }
Beispiel #5
0
        public void Insert(Game c)
        {
            PGame       p  = new PGame();
            List <Game> cs = p.Open();
            int         m  = 0;

            foreach (Game x in cs)
            {
                if (x.Id > m)
                {
                    m = x.Id;
                }
            }
            c.Id = m + 1;
            cs.Add(c);
            p.Save(cs);
        }
Beispiel #6
0
 public void Insert(Game g)
 {
     lg = p.Open();
     lg.Add(g);
     p.Save(lg);
 }