Esempio n. 1
0
 public static PI_SE_Administrador GetAdministrador(String sCorreo)
 {
     using (var dbContext = new wPremiosInstitucionalesdbEntities())
     {
         try
         {
             return(dbContext.GetAdministrador(sCorreo, null).FirstOrDefault());
         }
         catch (Exception Ex)
         {
             Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine);
             return(null);
         }
     }
 }
Esempio n. 2
0
 public static List <PI_SE_Administrador> GetAdministradores()
 {
     using (var dbContext = new wPremiosInstitucionalesdbEntities())
     {
         try
         {
             return(dbContext.GetAdministrador(null, null).ToList());
         }
         catch (Exception Ex)
         {
             Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine);
             return(null);
         }
     }
 }
Esempio n. 3
0
        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);
                }
            }
        }