Example #1
0
        public static bool RegistraCandidato(string email, string password, string nombre, string apellido, string codigoConfirmacion)
        {
            using (var dbContext = new wPremiosInstitucionalesdbEntities())
            {
                try
                {
                    // Si no hay ningun usuario registrado con ese correo
                    if (!ExisteUsuario(email))
                    {
                        dbContext.AddCandidato(Guid.NewGuid().ToString(), password, nombre, apellido, null, email, codigoConfirmacion, null, null, null, null, null, null);
                        dbContext.SaveChanges();
                        return(true);
                    }

                    // Si alguien ya esta registrado con este correo
                    return(false);
                }
                catch (Exception Ex)
                {
                    Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine);
                    return(false);
                }
            }
        }