예제 #1
0
 public Adress(City city, string street, string district,
               int number, string complement = null, string cep = null)
 {
     Cep        = DocumentFixer.Fix(cep);
     City       = city;
     CityId     = city?.Id;
     Street     = street;
     District   = district;
     Number     = number;
     Complement = complement;
 }
예제 #2
0
        public List <Fluxo> ListarFluxo(FluxoFilter filter)
        {
            if (filter == null || filter.StartDate == DateTime.MinValue || filter.EndDate == DateTime.MinValue)
            {
                filter = new FluxoFilter()
                {
                    StartDate = DateTime.Now.AddDays(-10),
                    EndDate   = DateTime.Now
                };
            }

            filter.CPF = DocumentFixer.Fix(filter.CPF);
            var statusId = EnumHelper.StatusParaStatusId(filter.Status);

            var fluxos = _fluxoRepository.ListarFluxo(filter.StartDate, filter.EndDate, statusId, filter.CPF, filter.Name)
                         .OrderByDescending(f => f.CreateDate)
                         .ToList();

            return(fluxos);
        }
예제 #3
0
        public Client(string name, string cpf, string rg, DateTime birthDate, string email, Adress adress,
                      List <Phone> phones = null, DateTime?modifiedDate = null) : this()
        {
            Name      = name;
            CPF       = DocumentFixer.Fix(cpf);
            RG        = DocumentFixer.Fix(rg);
            BirthDate = birthDate;
            Email     = email;

            if (CurrentStatus == null)
            {
                int idStatusEmCadastro = EnumHelper.StatusParaStatusId(EStatus.EM_CADASTRO);
                CurrentStatus   = new Status(idStatusEmCadastro, EStatus.EM_CADASTRO);
                CurrentStatusId = idStatusEmCadastro;
            }

            Adress   = adress;
            AdressId = adress?.Id;

            if (phones != null)
            {
                Phones = phones;
            }

            CreatedDate = DateTime.Now;

            if (modifiedDate.HasValue && modifiedDate.Value != DateTime.MinValue)
            {
                ModifiedDate = modifiedDate.Value;
            }
            else
            {
                ModifiedDate = DateTime.Now;
            }

            SetIsInternacional();
        }