Example #1
0
        public IResult Save(ConsumerDto consumerDto)
        {
            ConsumerEntity consumer = new ConsumerEntity(consumerDto);

            if (_consumerRepository.Get(consumer) != null)
            {
                return(new ValidateResult(consumer, false, "Cliente informado ja está vinculado a uma mesa"));
            }

            consumer.Validate();

            if (consumer.Invalid)
            {
                return(new ValidateResult(consumer.Notifications, false, "Problemas ao cadastrar o cliente"));
            }

            _consumerRepository.Add(consumer);
            return(new ValidateResult(consumer, true, "Cliente cadastrado com sucessso"));
        }
Example #2
0
 public void Add(string exchange, string qeueuName, string address, int typeId)
 {
     this.RegisterChannel(exchange, qeueuName, address, typeId);
     consumerRepository.Add(exchange, qeueuName, address, typeId);
 }