예제 #1
0
        public static void deleteAll()
        {
            DataBase db    = getDataBase();
            var      query = from a in db.Alunos select a;

            db.Alunos.DeleteAllOnSubmit(query);
            db.SubmitChanges();
        }
예제 #2
0
        public static string updateEstrelas(Alunos pAlu)
        {
            DataBase db     = getDataBase();
            Alunos   update = (from d in db.Alunos
                               where d.IdAluno == pAlu.IdAluno && d.IdDisc == pAlu.IdDisc
                               select d).First();

            update.NEstrelas = pAlu.NEstrelas + update.NEstrelas;
            db.SubmitChanges();

            return("Update feito com Sucesso!");
        }
예제 #3
0
 public static string save(Disciplinas pDisc)
 {
     if (pDisc.Nome != "")
     {
         DataBase db = getDataBase();
         db.Disciplinas.InsertOnSubmit(pDisc);
         db.SubmitChanges();
     }
     else
     {
         return("Preencha o campo Nome.");
     }
     return(pDisc.Nome + " cadastrado com Sucesso!");
 }
예제 #4
0
 public static string save(Alunos pAlu)
 {
     if (pAlu.Nome != "")
     {
         DataBase db = getDataBase();
         db.Alunos.InsertOnSubmit(pAlu);
         db.SubmitChanges();
     }
     else
     {
         return("Preencha o campo Nome.");
     }
     return(pAlu.Nome + " cadastrado com Sucesso");
 }