コード例 #1
0
ファイル: Email.cs プロジェクト: felippetadeu/frameworkfs
            public static void EnviarEmail(ConfiguracoesEmail configuracao)
            {
                MailMessage mail = new MailMessage();

                mail.From = new MailAddress(configuracao.De, string.IsNullOrEmpty(configuracao.NomeExibicao) ? configuracao.De : configuracao.NomeExibicao);
                foreach (var item in configuracao.Para.Split(';'))
                {
                    mail.To.Add(new MailAddress(item));
                }
                SmtpClient client = new SmtpClient();

                client.Port           = configuracao.Porta;
                client.DeliveryMethod = configuracao.MetodoEntrega;
                client.Host           = configuracao.Host;
                client.Credentials    = configuracao.CredenciaisEnvio;
                client.EnableSsl      = true;
                mail.Subject          = configuracao.Assunto;
                mail.IsBodyHtml       = configuracao.CorpoHtml;
                mail.Body             = configuracao.Corpo;
                client.Send(mail);
            }
コード例 #2
0
ファイル: Usuario.cs プロジェクト: MillerGS03/GITS
        public override int GetHashCode()
        {
            var hashCode = -1080711052;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CodUsuario);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Email);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Nome);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FotoPerfil);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Amigo> > .Default.GetHashCode(Amigos);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Amigo> > .Default.GetHashCode(Solicitacoes);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Tarefa> > .Default.GetHashCode(Tarefas);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Meta> > .Default.GetHashCode(Metas);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Notificacao> > .Default.GetHashCode(Notificacoes);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Acontecimento> > .Default.GetHashCode(Acontecimentos);

            hashCode = hashCode * -1521134295 + EqualityComparer <List <Item> > .Default.GetHashCode(Itens);

            hashCode = hashCode * -1521134295 + XP.GetHashCode();
            hashCode = hashCode * -1521134295 + Level.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Status);

            hashCode = hashCode * -1521134295 + Insignia.GetHashCode();
            hashCode = hashCode * -1521134295 + Dinheiro.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Titulo);

            hashCode = hashCode * -1521134295 + TemaSite.GetHashCode();
            hashCode = hashCode * -1521134295 + Decoracao.GetHashCode();
            hashCode = hashCode * -1521134295 + ConfiguracoesEmail.GetHashCode();
            return(hashCode);
        }
コード例 #3
0
ファイル: Usuario.cs プロジェクト: MillerGS03/GITS
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }
            if (obj.GetType() != typeof(Usuario))
            {
                return(false);
            }
            Usuario u = obj as Usuario;

            if (Nome != u.Nome)
            {
                return(false);
            }
            if (Email != u.Email)
            {
                return(false);
            }
            if (FotoPerfil != u.FotoPerfil)
            {
                return(false);
            }
            if (Status != u.Status)
            {
                return(false);
            }
            if (Insignia != u.Insignia)
            {
                return(false);
            }
            if (TemaSite != u.TemaSite)
            {
                return(false);
            }
            if (Decoracao != u.Decoracao)
            {
                return(false);
            }
            if (XP != u.XP)
            {
                return(false);
            }
            if (CodUsuario != u.CodUsuario)
            {
                return(false);
            }
            if (Amigos.Count != u.Amigos.Count)
            {
                return(false);
            }
            for (int i = 0; i < Amigos.Count; i++)
            {
                if (Amigos[i].Id != u.Amigos[i].Id || Amigos[i].FoiAceito != u.Amigos[i].FoiAceito || Amigos[i].FotoPerfil != u.Amigos[i].FotoPerfil)
                {
                    return(false);
                }
            }
            for (int i = 0; i < Solicitacoes.Count; i++)
            {
                if (Solicitacoes[i].Id != u.Solicitacoes[i].Id || Solicitacoes[i].FoiAceito != u.Solicitacoes[i].FoiAceito || Solicitacoes[i].FotoPerfil != u.Solicitacoes[i].FotoPerfil)
                {
                    return(false);
                }
            }
            if (Tarefas.Count != u.Tarefas.Count)
            {
                return(false);
            }
            for (int i = 0; i < Tarefas.Count; i++)
            {
                if (!Tarefas[i].Equals(u.Tarefas[i]))
                {
                    return(false);
                }
            }
            if (Metas.Count != u.Metas.Count)
            {
                return(false);
            }
            for (int i = 0; i < Metas.Count; i++)
            {
                if (!Metas[i].Equals(u.Metas[i]))
                {
                    return(false);
                }
            }
            if (Acontecimentos.Count != u.Acontecimentos.Count)
            {
                return(false);
            }
            for (int i = 0; i < Acontecimentos.Count; i++)
            {
                if (!Acontecimentos[i].Equals(u.Acontecimentos[i]))
                {
                    return(false);
                }
            }
            if (Notificacoes.Count != u.Notificacoes.Count)
            {
                return(false);
            }
            for (int i = 0; i < Notificacoes.Count; i++)
            {
                if (!Notificacoes[i].Equals(u.Notificacoes[i]))
                {
                    return(false);
                }
            }
            if (Itens.Count != u.Itens.Count)
            {
                return(false);
            }
            for (int i = 0; i < Itens.Count; i++)
            {
                if (!Itens[i].Equals(u.Itens[i]))
                {
                    return(false);
                }
            }
            if (!ConfiguracoesEmail.Equals(u.ConfiguracoesEmail))
            {
                return(false);
            }
            return(true);
        }