public static bool Inserir(Professor pf) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Guid guid = Guid.NewGuid(); pf.IdProfessor = guid; db.Professors.Add(pf); db.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static bool Inserir(Avaliador av) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Guid guid = Guid.NewGuid(); av.IdAvaliador = guid; db.Avaliadors.Add(av); db.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static bool Inserir(Aluno a) { try { s2aeiDBEntities db = new s2aeiDBEntities(); a.situacao = 1; //quando aluno é cadastrado, o status deve se tornar imediatamente ativo. db.Alunoes.Add(a); db.SaveChanges(); return(true); } catch (Exception) { throw; } }
public static bool SetSituacao(Avaliador a, byte status) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Avaliador av = new Avaliador(); av = db.Avaliadors.Find(a.IdAvaliador); av.situacao = status; db.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static bool SetSituacao(Professor p, byte status) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Professor pf = new Professor(); pf = db.Professors.Find(p.IdProfessor); pf.situacao = status; db.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static bool Desativar(Aluno a) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Aluno al = new Aluno(); al = db.Alunoes.Find(a.emaila); al.situacao = 0; db.SaveChanges(); return(true); } catch (Exception) { throw; } }
public static bool AlterarSenha(Aluno a) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Aluno al = new Aluno(); al = db.Alunoes.Find(a.emaila); al.senha = a.senha; db.SaveChanges(); return(true); } catch (Exception) { throw; } }
public static bool Alterar(Aluno a) { try { s2aeiDBEntities db = new s2aeiDBEntities(); Aluno al = new Aluno(); al = db.Alunoes.Find(a.emaila); al.Nome = a.Nome; al.periodo = a.periodo; al.campus = a.campus; al.curso = a.curso; db.SaveChanges(); return(true); } catch (Exception) { throw; } }