示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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;
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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;
            }
        }
示例#7
0
        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;
            }
        }
示例#8
0
        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;
            }
        }