Esempio n. 1
0
        public static Usuario FindByName(string nome)
        {
            UsuarioManipulation item = new UsuarioManipulation();
            Usuario             i    = item.FindByName(nome);

            return(i);
        }
Esempio n. 2
0
        public void CreateUsuario()
        {
            if (string.IsNullOrEmpty(Senha))
            {
                throw new MercurioCoreException("Defina a Senha");
            }
            if (base.Id != 0)
            {
                throw new MercurioCoreException("Usuario já criado no Banco de Dados");
            }
            if (Grupos.Count == 0)
            {
                throw new MercurioCoreException("Adicione Grupos de Usuarios");
            }
            UsuarioManipulation item = new UsuarioManipulation();

            if (item.FindByName(Nome) != null)
            {
                throw new MercurioCoreException("Usuario já criado no Banco de Dados");
            }
            Usuario novo = item.Create(this);

            foreach (Grupo g in Grupos)
            {
                g.AddGrupo((int)novo.Id);
            }
            Id = novo.Id;
        }
Esempio n. 3
0
        public void ChangeName(string nome)
        {
            UsuarioManipulation item = new UsuarioManipulation();

            if (item.FindByName(nome) != null)
            {
                throw new MercurioCoreException("Usuario já criado no Banco de Dados");
            }
            Nome = nome;
        }