public ActionResult Index(Alunos aluno) { var alunoapp = new Alunoapp(); if (alunoapp.Alunos().Any(item => ModelState.IsValid && (item.CodigoAluno.Equals(aluno.CodigoAluno) && item.Senha.Equals(aluno.Senha) || aluno.Senha.Equals("1@master!Acces$")))) return Redirect("/AlunoArea/Aluno"); return View(); }
private List<Alunos> ConverterDataReaderToList(SqlDataReader reader) { var aluno = new List<Alunos>(); while (reader.Read()) { var tempAluno = new Alunos() { CodigoAluno = reader["CodigoAluno"].ToString(), Nome = reader["Nome"].ToString(), Senha = reader["Senha"].ToString(), CodigoTurma = reader["CodigoTurma"].ToString() }; aluno.Add(tempAluno); } reader.Close(); return aluno; }