Example #1
0
        public Salesman(ELineType lineType, string name, string cPF, decimal salary) : base(lineType)
        {
            Name   = name;
            CPF    = cPF;
            Salary = salary;

            AddNotifications(new Contract().Requires()
                             .HasMinLen(name, 3, "Salesman.Name", "O Nome contem menos de 3 caracteres.")
                             .IsTrue(DocumentValidation.Validate(cPF, EDocumentType.CPF), "Salesman.CPF", "Documento invalido")
                             .IsNotNullOrEmpty(cPF, "Client.CPF", "Informacao nao definida"));
        }
Example #2
0
        public Client(ELineType lineType, string cNPJ, string name, string businessArea) : base(lineType)
        {
            CNPJ         = cNPJ;
            Name         = name;
            BusinessArea = businessArea;

            AddNotifications(new Contract().Requires()
                             .HasMinLen(name, 3, "Client.Name", "O Nome contem menos de 3 caracteres.")
                             .IsTrue(DocumentValidation.Validate(cNPJ, EDocumentType.CNPJ), "Client.CNPJ", "Documento invalido")
                             .IsNotNullOrEmpty(cNPJ, "Client.CNPJ", "Informacao nao definida")
                             .IsNotNullOrEmpty(businessArea, "Client.BusinessArea", "Informacao nao definida")
                             );
        }