public static PI_BA_Juez GetJuez(String sCorreo) { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { return(dbContext.GetJuez(sCorreo, null).FirstOrDefault()); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); return(null); } } }
public static List <PI_BA_Juez> GetJueces() { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { return(dbContext.GetJuez(null, null).ToList()); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); return(null); } } }
private static bool ExisteUsuario(string email) { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { int cantCandidatos = dbContext.GetCandidato(email, null).ToList().Count; int cantJueces = dbContext.GetJuez(email, null).ToList().Count; int cantAdmins = dbContext.GetAdministrador(email, null).ToList().Count; return((cantCandidatos + cantJueces + cantAdmins) > 0); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); return(false); } } }