Пример #1
0
        public void Store(int id, string name, int categoryId, decimal price, int StockQuantity)
        {
            var category = _categoryRepository.GetById(categoryId);

            DomainException.When(category == null, "category is required");

            var product = _productRepository.GetById(id);

            if (product == null)
            {
                product = new Product(name, category, price, StockQuantity);
                _productRepository.Save(product);
            }
            else
            {
                product.Update(name, category, price, StockQuantity);
            }
        }
Пример #2
0
        public void Store(int id, string name, decimal price, int stockQuantity, int categoryId)
        {
            var category = _categoryRepository.Get(categoryId);

            DomainException.When(category == null, "Category invalid!");

            var product = _productRepository.Get(id);

            if (product == null)
            {
                product = new Product(name, price, stockQuantity, category);
                _productRepository.Save(product);
            }
            else
            {
                product.Update(name, price, stockQuantity, category);
            }
        }
Пример #3
0
        public void Store(BookDto dto)
        {
            var author = _authorRepository.GetById(dto.AuthorId);

            DomainException.When(author == null, "Author invalid");

            var book = _bookRepository.GetById(dto.Id);

            if (book == null)
            {
                book = new Book(dto.Title);
                _bookRepository.Save(book);
            }
            else
            {
                book.Update(dto.Title);
            }
        }
Пример #4
0
        public void Store(ProductDto dto)
        {
            var category = _categoryRepository.GetById(dto.Categoryid);

            DomainException.When(category == null, "Category invalid");

            var product = _productRepository.GetById(dto.Id);

            if (product == null)
            {
                product = new Product(dto.Name, category, dto.Price, dto.StockQuantity);
                _productRepository.Save(product);
            }
            else//se o produto existe
            {
                product.Update(dto.Name, category, dto.Price, dto.StockQuantity);
            }
        }
Пример #5
0
        public void Store(ProductDTO dto)
        {
            var category = _repositoryCategory.GetById(dto.CategoryId);

            DomainException.When(category == null, "Category not exist");

            var product = _repositoryProduct.GetById(dto.Id);

            if (product == null)
            {
                product = new Product(dto.Name, category, dto.Price, dto.StockQuantity);
                _repositoryProduct.Save(product);
            }
            else
            {
                product.UpDate(dto.Name, category, dto.Price, dto.StockQuantity);
            }
        }
Пример #6
0
        public void Store(int id, int itemId, string nuor, DateTime dorg, DateTime dtrc, double qtnc)
        {
            var item = _itemRepository.GetById(itemId);

            DomainException.When(item == null, "Invalid Item");

            var order = _OrderRepository.GetById(id);

            if (order == null)
            {
                order = new Order(nuor, item, dorg, dtrc, qtnc);
                _OrderRepository.Save(order);
            }
            else
            {
                order.Update(nuor, item, dorg, dtrc, qtnc);
            }
        }
Пример #7
0
        private void ValidateAndSetProperties(bool parEsconderValorPagamentoSumula, string parCaminhoFotos, int parTamanhoFotos, string parExtensaoFotos, string parCaminhoFotosAtletas, int parTamanhoAlturaFotos, int parTamanhoLarguraFotos, int tipCodigo)
        {
            DomainException.When(string.IsNullOrEmpty(parCaminhoFotos), "Caminho para exibição das fotos não informado.");
            DomainException.When(parTamanhoFotos == 0, "Tamanho máximo para upload das fotos não informado.");
            DomainException.When(string.IsNullOrEmpty(parCaminhoFotosAtletas), "Caminho para exibição das fotos dos atletas não informado.");
            DomainException.When(parTamanhoAlturaFotos == 0, "Tamanho da altura das fotos não informado.");
            DomainException.When(parTamanhoLarguraFotos == 0, "Tamanho da largura das fotos não informado.");
            DomainException.When(tipCodigo == 0, "Tipo de receita dos atletas não informado.");

            this.parEsconderValorPagamentoSumula = parEsconderValorPagamentoSumula;
            this.parCaminhoFotos        = parCaminhoFotos;
            this.parTamanhoFotos        = parTamanhoFotos;
            this.parExtensaoFotos       = parExtensaoFotos;
            this.parCaminhoFotosAtletas = parCaminhoFotosAtletas;
            this.parTamanhoAlturaFotos  = parTamanhoAlturaFotos;
            this.parTamanhoLarguraFotos = parTamanhoLarguraFotos;
            this.tipCodigo = tipCodigo;
        }
Пример #8
0
        public void Armazenar(int id, string nome, int idCategoria, decimal preco, int qtdeEstoque)
        {
            var categoria = _categoriaRepository.GetById(idCategoria);

            DomainException.When(categoria == null, "Categoria Inválida");

            var produto = _produtoRepository.GetById(id);

            if (produto == null)
            {
                produto = new Produto(nome, categoria, preco, qtdeEstoque);
                _produtoRepository.Salvar(produto);
            }
            else
            {
                produto.Update(nome, categoria, preco, qtdeEstoque);
            }
        }
        public void Store(ProdutoDto dto)
        {
            var categoria = _categoriaRepository.GetById(dto.CategoriaId);

            DomainException.When(categoria == null, "Categoria inválida.");

            var produto = _produtoRepository.GetById(dto.Id);

            if (produto == null)
            {
                produto = new Produto(dto.Nome, categoria, dto.Preco, dto.QuantidadeEmEstoque);
                _produtoRepository.Save(produto);
            }
            else
            {
                produto.Atualizar(dto.Nome, categoria, dto.Preco, dto.QuantidadeEmEstoque);
            }
        }
Пример #10
0
        public void Store(int id, int orderId, string nope, int nseq, string dope)
        {
            var order = _OrderRepository.GetById(orderId);

            DomainException.When(order == null, "Invalid Order");

            var operation = _OperationRepository.GetById(id);

            if (operation == null)
            {
                operation = new Operation(order, nope, nseq, dope);
                _OperationRepository.Save(operation);
            }
            else
            {
                operation.Update(order, nope, nseq, dope);
            }
        }
Пример #11
0
        public void Store(int Id, string Name, int CategoryId, decimal Price, int StockQuantity)
        {
            var category = _categoryRepository.GetById(CategoryId);

            DomainException.When(category == null, "Category invalid");

            var product = _productRepository.GetById(Id);

            if (product == null)
            {
                product = new Product(Name, category, Price, StockQuantity);
                _productRepository.Save(product);
            }
            else
            {
                product.Update(Name, category, Price, StockQuantity);
            }
        }
Пример #12
0
        private void ValidateAndSetProperties(string advNome, string advResponsavel, int advDDD1, int advTelefone1, int advDDD2, int advTelefone2, int advDDD3, int advTelefone3, bool advComQuadra, int quaCodigo)
        {
            DomainException.When(string.IsNullOrEmpty(advNome), "Nome do Adversário não informado.");
            DomainException.When(string.IsNullOrEmpty(advResponsavel), "Nome do Responsável não informado.");
            DomainException.When(advDDD1 == 0, "DDD não informado.");
            DomainException.When(advTelefone1 == 0, "Telefone não informado.");

            this.advDataInclusao = DateTime.Now;
            this.advNome         = advNome;
            this.advResponsavel  = advResponsavel;
            this.advDDD1         = advDDD1;
            this.advTelefone1    = advTelefone1;
            this.advDDD2         = advDDD2;
            this.advTelefone2    = advTelefone2;
            this.advDDD3         = advDDD3;
            this.advTelefone3    = advTelefone3;
            this.advComQuadra    = advComQuadra;
            this.quaCodigo       = quaCodigo;
        }
Пример #13
0
        private void ValidateAndSetProperties(string atlNome, double atlCPF, string atlRG, DateTime atlDataNascimento, int posCodigo, int equCodigo, bool atlPrimeiroQuadro, bool atlSegundoQuadro, bool atlIsentoPagamento, string atlFoto)
        {
            DomainException.When(string.IsNullOrEmpty(atlNome), "Nome do Atleta não informado.");
            DomainException.When(atlDataNascimento == DateTime.MinValue, "Data de Nascimento não informada.");
            DomainException.When(posCodigo == 0, "Posição que o Atleta joga não informada.");
            DomainException.When(equCodigo == 0, "Equipe não informada.");

            this.atlDataInclusao    = DateTime.Now;
            this.atlNome            = atlNome;
            this.atlCPF             = atlCPF;
            this.atlRG              = atlRG;
            this.atlDataNascimento  = atlDataNascimento;
            this.posCodigo          = posCodigo;
            this.equCodigo          = equCodigo;
            this.atlPrimeiroQuadro  = atlPrimeiroQuadro;
            this.atlSegundoQuadro   = atlSegundoQuadro;
            this.atlIsentoPagamento = atlIsentoPagamento;
            this.atlFoto            = atlFoto;
        }
Пример #14
0
        public async Task Authenticate(string login, string senha)
        {
            var usuario = _dbContext.Set <UsuarioEN>().Where(obj => obj.usuLogin == login && obj.usuSenha == senha);

            DomainException.When(usuario == null || !usuario.Any(), "Usuário ou Senhas Inválidos.");

            var claims = new List <Claim>
            {
                new Claim("ID", usuario.FirstOrDefault().usuCodigo.ToString()),
                new Claim(ClaimTypes.Name, usuario.FirstOrDefault().usuLogin),
                new Claim(ClaimTypes.Email, usuario.FirstOrDefault().usuEmail ?? ""),
                new Claim("FullName", usuario.FirstOrDefault().usuNome),
                new Claim(ClaimTypes.Role, "Administrator"),
            };

            var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);

            await _httpContextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity));
        }
Пример #15
0
        public void Store(ContaBancariaDto dto)
        {
            var empresa = _empresarepository.GetById(dto.EMPRESAID);

            DomainException.When(empresa == null, "Empresa Invalida");

            var contabancaria = _contabancariarepository.GetById(dto.ID);

            if (contabancaria is null)
            {
                contabancaria = new ContaBancaria(empresa, dto.DESCRICAO, dto.CODBANCO, dto.AGENCIA, dto.CONTA, dto.GERENTE, dto.TELEFONE, dto.DATAABERTURA);
                _contabancariarepository.Save(contabancaria);
            }
            else
            {
                contabancaria.Update(empresa, dto.DESCRICAO, dto.CODBANCO, dto.AGENCIA, dto.CONTA, dto.GERENTE, dto.TELEFONE, dto.DATAABERTURA);
                _contabancariarepository.Save(contabancaria);
            }
        }
Пример #16
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, string CNPJ, string RazaoSocial, string NomeFantasia, string CEP, string Endereco, string Numero, string Complemento, string Bairro, string Cidade, string UF, string Telefone, string Celular, string NomeRespEmpresa, string CPFResponsavel, string TelResponsavel, string EmailResponsavel)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(string.IsNullOrEmpty(CNPJ), "CNPJ não informado.");
            DomainException.When(string.IsNullOrEmpty(RazaoSocial), "Razão Social não informada.");
            DomainException.When(string.IsNullOrEmpty(NomeFantasia), "Nome Fantasia não informada.");
            DomainException.When(string.IsNullOrEmpty(CEP), "CEP não informado.");
            DomainException.When(string.IsNullOrEmpty(Endereco), "Endereço não informado.");
            DomainException.When(string.IsNullOrEmpty(Numero), "Número não informado.");
            DomainException.When(string.IsNullOrEmpty(Bairro), "Bairro não informado.");
            DomainException.When(string.IsNullOrEmpty(Cidade), "Cidade não informada.");
            DomainException.When(string.IsNullOrEmpty(NomeRespEmpresa), "Nome do Responsável pela Empresa não informado.");
            DomainException.When(string.IsNullOrEmpty(TelResponsavel), "Teefone do Responsável pela Empresa não informado.");

            this.IDCompany        = IDCompany;
            this.IDUser           = IDUser;
            this.StatusEmpresa    = "a";
            this.NrMatricula      = CNPJ;
            this.RazaoSocial      = RazaoSocial;
            this.NomeFantasia     = NomeFantasia;
            this.Cep              = CEP;
            this.Endereco         = Endereco;
            this.Numero           = Numero;
            this.Complemento      = Complemento;
            this.Bairro           = Bairro;
            this.Cidade           = Cidade;
            this.UF               = UF;
            this.Telefone         = Telefone;
            this.Celular          = Celular;
            this.NomeContato      = "";
            this.CPFContato       = "";
            this.TelContato       = "";
            this.TipoEmp          = "";
            this.NomeRespEmpresa  = NomeRespEmpresa;
            this.CPFResponsavel   = CPFResponsavel;
            this.TelResponsavel   = TelResponsavel;
            this.NitResponsavel   = "";
            this.EmailResponsavel = EmailResponsavel;
            this.DescNatJurid     = "";
            this.CnaeDesc         = "";
        }
Пример #17
0
        private void CheckProduto(ProdutoDomain ClienteObj = null, IEnumerable <ProdutoDomain> ListClientObj = null)
        {
            var listaCloente = new List <ProdutoDomain>();

            if (ListClientObj != null)
            {
                listaCloente = ListClientObj.ToList();
            }

            if (ClienteObj != null)
            {
                listaCloente.Add(ClienteObj);
            }

            foreach (var obj in listaCloente)
            {
                DomainException.When(string.IsNullOrEmpty(obj.ProdutoNome), ErrorMessages.PRODUTONOME);
                DomainException.When(obj.ProdutoValor <= 0, ErrorMessages.PRODUTOVALOR);
            }
        }
Пример #18
0
        private void ValidateAndSetProperties(string equNome, string equResponsavel, DateTime equDataFundacao, int equDDD1, int equTelefone1, int equDDD2, int equTelefone2, bool equComQuadra, int quaCodigo, string equHorario)
        {
            DomainException.When(string.IsNullOrEmpty(equNome), "Nome do Adversário não informado.");
            DomainException.When(string.IsNullOrEmpty(equResponsavel), "Nome do Responsável não informado.");
            DomainException.When(equDDD1 == 0, "DDD não informado.");
            DomainException.When(equTelefone1 == 0, "Telefone não informado.");
            DomainException.When(equDataFundacao == DateTime.MinValue, "Data da Fundação não informada.");

            this.equDataInclusao = DateTime.Now;
            this.equNome         = equNome;
            this.equResponsavel  = equResponsavel;
            this.equDataFundacao = equDataFundacao;
            this.equDDD1         = equDDD1;
            this.equTelefone1    = equTelefone1;
            this.equDDD2         = equDDD2;
            this.equTelefone2    = equTelefone2;
            this.equComQuadra    = equComQuadra;
            this.quaCodigo       = quaCodigo;
            this.equHorario      = equHorario;
        }
Пример #19
0
        public Image(string data, string mime, string user, string alt_PT, string alt_ENG)
        {
            DomainException.When(!string.IsNullOrEmpty(data), "Data is required!");
            DomainException.When(!string.IsNullOrEmpty(mime), "Mime is required!");

            DomainException.When(!string.IsNullOrEmpty(alt_PT), "Alt_PT is required!");
            DomainException.When(!(alt_PT.Length < 5), "Alt_PT - 5 character minimum!");
            DomainException.When(!(alt_PT.Length > 95), "Alt_PT - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(alt_ENG), "Alt_ENG is required!");
            DomainException.When(!(alt_ENG.Length < 5), "Alt_ENG - 5 character minimum!");
            DomainException.When(!(alt_ENG.Length > 95), "Alt_ENG - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(user), "CreatedBy is required!");

            this.Data      = data;
            this.Mime      = mime;
            this.Alt_PT    = alt_PT;
            this.Alt_ENG   = alt_ENG;
            this.CreatedBy = user;
        }
Пример #20
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, string SKU, string Nome, string Descricao, int IDFornecedor, int IDCategoria, int IDSubCategoria, decimal Preco)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            //DomainException.When(string.IsNullOrEmpty(SKU), "SKU não informado.");
            DomainException.When(string.IsNullOrEmpty(Nome), "Nome não informado.");
            DomainException.When(string.IsNullOrEmpty(Descricao), "Descrição não informada.");
            DomainException.When(IDFornecedor == 0, "Fornecedor não informado.");
            DomainException.When(IDCategoria == 0, "Categoria não informada.");
            DomainException.When(Preco == 0, "Preço não informado.");

            this.IDCompany      = IDCompany;
            this.IDUser         = IDUser;
            this.SKU            = SKU;
            this.Nome           = Nome;
            this.Descricao      = Descricao;
            this.IDFornecedor   = IDFornecedor;
            this.IDCategoria    = IDCategoria;
            this.IDSubCategoria = IDSubCategoria;
            this.Preco          = Preco;
        }
Пример #21
0
        public void Store(int id, string nome, string cpf, string rg, string endereco, string cep, string cidade, string estado, string pais, int cargoId, int departamentoId)
        {
            var cargo = _cargoRepository.GetById(cargoId);

            DomainException.When(cargo == null, "Cargo é obrigatório");

            var departamento = _departamentoRepository.GetById(departamentoId);

            DomainException.When(departamento == null, "Departamento é obrigatório");

            var funcionario = _funcionarioRepository.GetById(id);

            if (funcionario == null)
            {
                funcionario = new Funcionario(nome, cpf, rg, endereco, cep, cidade, estado, pais, cargo, departamento);
                _funcionarioRepository.Save(funcionario);
            }
            else
            {
                funcionario.Update(nome, cpf, rg, endereco, cep, cidade, estado, pais, cargo, departamento);
            }
        }
Пример #22
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, DateTime DataVenda, PedidoVendaStatusEnum Status, int IDUsuario, int IDVendedor, int IDEmpresa, TipoPagamentoEnum TipoPagamento, QtdeParcelasEnum QtdeParcelas, string Observacao, bool VendaExpress)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(DataVenda == DateTime.MinValue, "Data da Venda Inválida.");
            DomainException.When(Status == 0, "Status não informado.");
            DomainException.When(IDVendedor == 0, "Vendedor não informado.");
            DomainException.When(IDEmpresa == 0, "Cliente não informado.");
            DomainException.When(QtdeParcelas == 0, "Qtde de Parcelas Inválida.");

            this.IDCompany     = IDCompany;
            this.IDUser        = IDUser;
            this.DataVenda     = DataVenda;
            this.Status        = Status;
            this.IDUsuario     = IDUsuario;
            this.IDVendedor    = IDVendedor;
            this.IDEmpresa     = IDEmpresa;
            this.TipoPagamento = TipoPagamento;
            this.QtdeParcelas  = QtdeParcelas;
            this.Observacao    = Observacao;
            this.VendaExpress  = VendaExpress;
        }
Пример #23
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, DateTime DataServico, string HorarioServico, OrdemServicoStatusEnum Status, int IDEmpresa, int IDResp, int IDLocal, string NomeContato, string Telefone, string WhatsApp, bool OSExpress)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(DataServico == DateTime.MinValue, "Data do Serviço Inválida.");
            DomainException.When(string.IsNullOrEmpty(HorarioServico), "Horário do Serviço não informado.");
            DomainException.When(Status == 0, "Status não informado.");
            DomainException.When(IDResp == 0, "Responsável pelo serviço não informado.");
            DomainException.When(IDLocal == 0, "Local do serviço não informado.");

            this.IDCompany      = IDCompany;
            this.IDUser         = IDUser;
            this.DataServico    = DataServico;
            this.HorarioServico = HorarioServico;
            this.Status         = Status;
            this.IDEmpresa      = IDEmpresa;
            this.IDResp         = IDResp;
            this.IDLocal        = IDLocal;
            this.NomeContato    = NomeContato;
            this.Telefone       = Telefone;
            this.WhatsApp       = WhatsApp;
            this.OSExpress      = OSExpress;
        }
Пример #24
0
        /// <summary>
        /// Constructor for Intro
        /// </summary>
        /// <param name="title_PT"></param>
        /// <param name="text_PT"></param>
        /// <param name="title_ENG"></param>
        /// <param name="text_ENG"></param>
        public StaticFirstPage(string title_PT, string text_PT, string title_ENG, string text_ENG)
        {
            DomainException.When(!string.IsNullOrEmpty(title_PT), "Title_PT is required!");
            DomainException.When(!(title_PT.Length < 5), "Title_PT - 5 character minimum!");
            DomainException.When(!(title_PT.Length > 95), "Title_PT - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_PT), "Text_PT is required!");
            DomainException.When(!(text_PT.Length < 5), "Text_PT - 5 character minimum!");
            DomainException.When(!(text_PT.Length > 8000), "Text_PT - 8000 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(title_ENG), "Title_ENG is required!");
            DomainException.When(!(title_ENG.Length < 5), "Title_ENG - 5 character minimum!");
            DomainException.When(!(title_ENG.Length > 95), "Title_ENG - 95 character maximum!");

            DomainException.When(!string.IsNullOrEmpty(text_ENG), "Text_ENG is required!");
            DomainException.When(!(text_ENG.Length < 5), "Text_ENG - 5 character minimum!");
            DomainException.When(!(text_ENG.Length > 8000), "Text_ENG - 8000 character maximum!");

            this.Title_PT  = title_PT;
            this.Text_PT   = text_PT;
            this.Title_ENG = title_ENG;
            this.Text_ENG  = text_ENG;
        }
Пример #25
0
        public void store(ContasPagasDto dto)
        {
            var empresa       = _empresarepository.GetById(dto.EMPRESAID);
            var fornecedor    = _fornecedorrepository.GetById(dto.FORNECEDORID);
            var contabancaria = _contabancariarepository.GetById(dto.CONTABANCARIAID);

            DomainException.When(empresa == null, "Precisa de Empresa");
            DomainException.When(fornecedor == null, "Precisa de Fornecedor");
            DomainException.When(contabancaria == null, "Precisa de Conta Bancaria");

            var contaspagar = _contapagarrepository.GetById(dto.ID);

            if (contaspagar is null)
            {
                contaspagar = new ContasPagas(dto.DESCRICAO, empresa, fornecedor, contabancaria, dto.TIPOPAGAMENTO, dto.FAVORECIDO, dto.DOCUMENTO, dto.STATUSPAGAMENTO, dto.VALOR, dto.DATACONTA, dto.DATAPAGAMENTO, dto.PREVPAGAMENTO, dto.OBSERVACAO, dto.DATATIME);
                _contapagarrepository.Save(contaspagar);
            }
            else
            {
                contaspagar.Update(dto.DESCRICAO, empresa, fornecedor, contabancaria, dto.TIPOPAGAMENTO, dto.FAVORECIDO, dto.DOCUMENTO, dto.STATUSPAGAMENTO, dto.VALOR, dto.DATACONTA, dto.DATAPAGAMENTO, dto.PREVPAGAMENTO, dto.OBSERVACAO, dto.DATATIME);
                _contapagarrepository.Save(contaspagar);
            }
        }
Пример #26
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, string Nome, string RG, string CPF, DateTime DataNascimento, string Email, string CEP, string Endereco, string Numero, string Complemento, string Bairro, string Cidade, string UF, int IDEmpresa, string NomeContato, string Telefone, string WhatsApp, string Observacao)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(string.IsNullOrEmpty(Nome), "Nome não informado.");
            DomainException.When(string.IsNullOrEmpty(RG), "RG não informado.");
            DomainException.When(string.IsNullOrEmpty(CPF), "CPF não informado.");
            DomainException.When(string.IsNullOrEmpty(Email), "E-mail não informado.");
            DomainException.When(IDEmpresa == 0, "Empresa não informada.");
            //DomainException.When(string.IsNullOrEmpty(CEP), "CEP não informado.");
            //DomainException.When(string.IsNullOrEmpty(Endereco), "Endereço não informado.");
            //DomainException.When(string.IsNullOrEmpty(Numero), "Número não informado.");
            //DomainException.When(string.IsNullOrEmpty(Bairro), "Bairro não informado.");
            //DomainException.When(string.IsNullOrEmpty(Cidade), "Cidade não informada.");
            //DomainException.When(string.IsNullOrEmpty(UF), "UF não informada.");

            this.IDCompany      = IDCompany;
            this.IDUser         = IDUser;
            this.Nome           = Nome;
            this.RG             = RG;
            this.CPF            = CPF;
            this.DataNascimento = DataNascimento;
            this.Email          = Email;
            this.CEP            = CEP;
            this.Endereco       = Endereco;
            this.Numero         = Numero;
            this.Complemento    = Complemento;
            this.Bairro         = Bairro;
            this.Cidade         = Cidade;
            this.UF             = UF;
            this.IDEmpresa      = IDEmpresa;
            this.NomeContato    = NomeContato;
            this.Telefone       = Telefone;
            this.WhatsApp       = WhatsApp;
            this.Observacao     = Observacao;
        }
Пример #27
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, string NomeEstab, string CepEstab, string EnderecoEstab, string NumEstab, string ComplementoEstab, string BairroEstab, string CidadeEstab, string UFEstab)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(string.IsNullOrEmpty(NomeEstab), "Nome do Estabelecimento não informada.");
            DomainException.When(string.IsNullOrEmpty(CepEstab), "CEP não informado.");
            DomainException.When(string.IsNullOrEmpty(EnderecoEstab), "Endereço não informado.");
            DomainException.When(string.IsNullOrEmpty(NumEstab), "Número não informado.");
            DomainException.When(string.IsNullOrEmpty(BairroEstab), "Bairro não informado.");
            DomainException.When(string.IsNullOrEmpty(CidadeEstab), "Cidade não informada.");
            DomainException.When(string.IsNullOrEmpty(UFEstab), "UF não informada.");

            this.IDCompany        = IDCompany;
            this.IDUser           = IDUser;
            this.StatusAtivo      = "a";
            this.NomeEstab        = NomeEstab;
            this.CepEstab         = CepEstab;
            this.EnderecoEstab    = EnderecoEstab;
            this.NumEstab         = NumEstab;
            this.ComplementoEstab = ComplementoEstab;
            this.BairroEstab      = BairroEstab;
            this.CidadeEstab      = CidadeEstab;
            this.UFEstab          = UFEstab;
        }
Пример #28
0
        private void ValidateAndSetProperties(int IDCompany, int IDUser, int IDEmpresa, string NumeroTitulo, int Seq, DateTime DataVencimento, decimal Valor, decimal ValorPago, OrigemContasReceberEnum Origem, int Chave, string LinkFatura, ContasReceberStatusEnum Status, string Observaca)
        {
            DomainException.When(IDCompany == 0, "Compania não informada.");
            DomainException.When(IDUser == 0, "Usuário não informado.");
            DomainException.When(IDEmpresa == 0, "Cliente não informado.");
            DomainException.When(string.IsNullOrEmpty(NumeroTitulo), "Número do Título não informado.");
            DomainException.When(Seq == 0, "Sequência não informada.");
            DomainException.When(DataVencimento == DateTime.MinValue, "Data da Vencimento Inválida.");
            DomainException.When(Valor == 0, "Valor do Título não informado.");

            this.IDCompany      = IDCompany;
            this.IDUser         = IDUser;
            this.IDEmpresa      = IDEmpresa;
            this.NumeroTitulo   = NumeroTitulo;
            this.Seq            = Seq;
            this.DataVencimento = DataVencimento;
            this.Valor          = Valor;
            this.ValorPago      = ValorPago;
            this.Origem         = Origem;
            this.Chave          = Chave;
            this.LinkFatura     = LinkFatura;
            this.Status         = Status;
            this.Observacao     = Observaca;
        }
Пример #29
0
        private void ValidateAndSetName(string name)
        {
            DomainException.When(string.IsNullOrEmpty(name), "Name is required");

            Name = name;
        }
Пример #30
0
        private void ValidarESetarPropriedades(string nome)
        {
            DomainException.When(string.IsNullOrEmpty(nome), "Nome é obrigatório.");

            Nome = nome;
        }