コード例 #1
0
        public void InserirDisciplina(MDisciplina x)
        {
            i = new PDisciplina();
            List <MDisciplina> a = i.Open();
            int id = 1;

            if (a.Count > 0)
            {
                id = a.Max(y => y.Id) + 1;
            }
            x.Id = id;
            a.Add(x);
            i.Save(a);
        }
コード例 #2
0
        public void ExcluirDisciplina(MDisciplina x)
        {
            i = new PDisciplina();
            List <MDisciplina> a = i.Open();

            foreach (MDisciplina j in a)
            {
                if (j.Id == x.Id)
                {
                    a.Remove(j);
                    break;
                }
            }
            i.Save(a);
        }
コード例 #3
0
 public List <MDisciplina> ListarDisciplina()
 {
     i = new PDisciplina();
     return(i.Open().OrderBy(a => a.Nivel).ToList());
 }