Exemple #1
0
        public void Delete(MAutor c)
        {
            PAutor        p  = new PAutor();
            List <MAutor> cs = p.Open();

            for (int i = 0; i < cs.Count; i++)
            {
                if (cs[i].Id == c.Id)
                {
                    cs.RemoveAt(i);
                    break;
                }
            }
            p.Save(cs);
        }
Exemple #2
0
        public void Insert(MAutor c)
        {
            PAutor        p  = new PAutor();
            List <MAutor> cs = p.Open();
            int           m  = 0;

            foreach (MAutor x in cs)
            {
                if (x.Id > m)
                {
                    m = x.Id;
                }
            }
            c.Id = m + 1;
            cs.Add(c);
            p.Save(cs);
        }
Exemple #3
0
        public List <MAutor> Select()
        {
            PAutor p = new PAutor();

            return(p.Open().OrderBy(c => c.Nome).ToList());
        }
Exemple #4
0
 public void Insert(Autor g)
 {
     v = p.Open();
     v.Add(g);
     p.Save(v);
 }