コード例 #1
0
        public void Validate()
        {
            AddNotifications(
                new Contract()
                .Requires()
                .IsNotNullOrEmpty(IdSistema.ToString(), "IdSistema", "O IdSistema deve ser informado")
                .IsNotNullOrEmpty(Ativo.ToString(), "Ativo", "O campo Ativo deve ser informado")
                );

            AddNotifications(
                new Contract()
                .Requires().IsTrue(PossuirSistemaCadastrado(), IdSistema.ToString(), "O IdSistema informado não foi localizado!")
                );
        }
コード例 #2
0
        public void Validate()
        {
            AddNotifications(
                new Contract()
                .Requires()
                .IsNotNullOrEmpty(IdSistema.ToString(), "IdSistema", "O IdSistema deve ser informado")
                .HasMinLen(Nome, 5, "Nome", "O campo descrição deve ter no mínimo 5 caracteres")
                .HasMinLen(Descricao, 5, "Descricao", "O campo descrição deve ter no mínimo 5 caracteres")
                );

            AddNotifications(
                new Contract()
                .Requires().IsTrue(PossuirSistemaCadastrado(), IdSistema.ToString(), "O IdSistema informado não foi localizado!")
                );
        }