public void InsertPartida(ModJogo x)
        {
            p = new PerJogo();
            List <ModJogo> cs = p.Open();
            int            id = 1;

            if (cs.Count > 0)
            {
                id = cs.Max(c => c.IdPartida) + 1;
            }
            x.IdPartida = id;
            cs.Add(x);
            p.Save(cs);
        }
        public void DeletePartida(ModJogo x)
        {
            p = new PerJogo();
            List <ModJogo> del = p.Open();

            for (int i = 0; i < del.Count; i++)
            {
                if (del[i].IdPartida == x.IdPartida)
                {
                    del.RemoveAt(i);
                    break;
                }
            }
            p.Save(del);
        }
        public void UpdatePartida(ModJogo x)
        {
            p = new PerJogo();
            List <ModJogo> up = p.Open();

            for (int i = 0; i < up.Count; i++)
            {
                if (up[i].IdPartida == x.IdPartida)
                {
                    up.RemoveAt(i); break;
                }
            }

            up.Add(x);
            p.Save(up);
        }
 public List <ModJogo> SelectPartida()
 {
     p = new PerJogo();
     return(p.Open().OrderBy(ModJogo => ModJogo.IdPartida).ToList());
 }