public static void deleteAll() { DataBase db = getDataBase(); var query = from a in db.Alunos select a; db.Alunos.DeleteAllOnSubmit(query); db.SubmitChanges(); }
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!"); }
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!"); }
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"); }