public CreateAgendaRequestValidator(IAgendaService agendaService, ISalaService salaService, IMapper mapper)
        {
            RuleFor(r => r.Titulo)
            .Must(p => !string.IsNullOrEmpty(p.Trim())).WithMessage("Campo [título] não deve ser vazio");

            RuleFor(r => r.HorarioInicio)
            .NotEmpty().WithMessage("Campo [Horário Início] é obrigatório");

            RuleFor(r => r.HorarioFim)
            .NotEmpty().WithMessage("Campo [Horário Fim] é obrigatório")
            .Must((entity, p) =>
            {
                return(agendaService.ValidateSalaHorario(mapper.Map <Agenda>(entity)));
            }).WithMessage("O horário indicado já está em uso para a sala");

            RuleFor(r => r.HorarioInicio)
            .LessThan(f => f.HorarioFim).WithMessage("Horário inicial deve ser menor do que horário final");

            RuleFor(r => r.SalaId)
            .NotEmpty().WithMessage("Campo [Sala] é obrigatório")
            .Must(p =>
            {
                var sala = salaService.GetAsync(p).Result;
                return(sala != null);
            }).WithMessage(m => "A sala de Id " + m.SalaId + " não existe");
        }
 public SalasController(ISalasRepository salasRepository,
                        IMapper iMapper,
                        ISalaService salaService)
 {
     _iSalasRepository = salasRepository;
     _iMapper          = iMapper;
     _salaService      = salaService;
 }
예제 #3
0
 public ReservasController(ISalaRepository salaRepository, IReservaRepository reservaRepository, IMapper mapper, ISalaService salaService, IReservaService reservaService, INotificador notificador, IUser user) : base(notificador, user)
 {
     _salaRepository    = salaRepository;
     _reservaRepository = reservaRepository;
     _mapper            = mapper;
     _salaService       = salaService;
     _reservaService    = reservaService;
 }
 public AgendamentosController(IAgendamentoService agendamentoService,
                               IUsuarioService usuarioService,
                               ISalaService salaService)
 {
     _agendamentoService = agendamentoService;
     _usuarioService     = usuarioService;
     _salaService        = salaService;
 }
예제 #5
0
        public AdicionarParticipanteTest()
        {
            var sala  = new Sala("Sala1");
            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
        }
예제 #6
0
 public AgendamentoService(IAgendamentoRepository agendamentoRepository,
                           IUsuarioService usuarioService,
                           ISalaService salaService,
                           IEmailService emailService)
 {
     _agendamentoRepository = agendamentoRepository;
     _usuarioService        = usuarioService;
     _emailService          = emailService;
     _salaService           = salaService;
 }
예제 #7
0
        public EnviarMensagemPublicaTest()
        {
            var sala  = new Sala("Sala1");
            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
            _salaService.AdicionarParticipante("Sala1", "Pedro");
        }
 public MetodosAuxiliaresController(ISalaService salaService,
                                    IUsuarioService usuarioService,
                                    IUsuarioOrganizacaoService usuarioOrganizacaoService,
                                    IBlocoService blocoService,
                                    IOrganizacaoService organizacaoService)
 {
     _salaService               = salaService;
     _usuarioService            = usuarioService;
     _usuarioOrganizacaoService = usuarioOrganizacaoService;
     _blocoService              = blocoService;
     _organizacaoService        = organizacaoService;
 }
예제 #9
0
        public AgendaTest()
        {
            salaRepository   = new MockSalaRepository();
            agendaRepository = new MockAgendaRepository(salaRepository);
            salaService      = new SalaService(salaRepository);
            agendaService    = new AgendaService(agendaRepository);
            var mapperConfig = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile <RequestToDomainProfile>();
            });

            mapper = mapperConfig.CreateMapper();
        }
 public SalaParticularController(ISalaService salaService,
                                 ISalaParticularService salaParticularService,
                                 IUsuarioService usuarioService,
                                 IBlocoService blocoService,
                                 IUsuarioOrganizacaoService usuarioOrganizacaoService,
                                 IOrganizacaoService organizacaoService)
 {
     _salaService               = salaService;
     _salaParticularService     = salaParticularService;
     _usuarioService            = usuarioService;
     _blocoService              = blocoService;
     _usuarioOrganizacaoService = usuarioOrganizacaoService;
     _organizacaoService        = organizacaoService;
 }
 public HardwareDeSalaController(IHardwareDeSalaService hardwareService,
                                 ITipoHardwareService tipoHardwareService,
                                 ISalaService salaService,
                                 IUsuarioService usuarioService,
                                 IOrganizacaoService organizacaoService,
                                 IBlocoService blocoService)
 {
     _hardwareService     = hardwareService;
     _tipoHardwareService = tipoHardwareService;
     _salaService         = salaService;
     _usuarioService      = usuarioService;
     _organizacaoService  = organizacaoService;
     _blocoService        = blocoService;
 }
예제 #12
0
        public ObterMensagensDoParticipanteTest()
        {
            var sala = new Sala("Sala1");

            sala.AdicionarParticipante("Maria");
            sala.EnviarMensagemPublica("Bom dia pessoal", "Maria");

            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
        }
 public PlanejamentoController(IPlanejamentoService service,
                               ISalaService salaService,
                               IUsuarioService usuarioService,
                               IUsuarioOrganizacaoService usuarioOrganizacaoService,
                               IBlocoService blocoService,
                               IOrganizacaoService organizacaoService)
 {
     _planejamentoService       = service;
     _salaService               = salaService;
     _usuarioService            = usuarioService;
     _usuarioOrganizacaoService = usuarioOrganizacaoService;
     _blocoService              = blocoService;
     _organizacaoService        = organizacaoService;
 }
예제 #14
0
 public CitaController(
     ICitaService citaService,
     IMedicoService medicoService,
     ISalaService salaService,
     ITipoServicioService tipoServicioService,
     IPacienteService pacienteService)
 {
     _citaService         = citaService;
     _medicoService       = medicoService;
     _salaService         = salaService;
     _tipoServicioService = tipoServicioService;
     _pacienteService     = pacienteService;
     _horarios            = new List <SelectListItem>();
 }
예제 #15
0
 public CreateSalaRequestValidator(ISalaService salaService)
 {
     RuleFor(r => r.Descricao)
     .Must(p => !string.IsNullOrEmpty(p.Trim())).WithMessage("Campo [descrição] não deve ser vazio")
     .Must((obj, p) =>
     {
         var salas = salaService.GetByDescricaoAsync(obj.Descricao).Result;
         if (salas.Count() > 0)
         {
             return(false);
         }
         return(true);
     })
     .WithMessage(m => "A descrição \'" + m.Descricao + "\' já existe");
 }
예제 #16
0
 public HomeController(ISalaParticularService salaParticularService,
                       ISalaService salaService,
                       IBlocoService blocoService,
                       IUsuarioService usuarioService,
                       IMonitoramentoService monitoramentoService,
                       IHorarioSalaService horarioSalaService,
                       ICodigoInfravermelhoService codigoInfravermelhoService)
 {
     _salaService                = salaService;
     _salaParticularService      = salaParticularService;
     _blocoService               = blocoService;
     _monitoramentoService       = monitoramentoService;
     _usuarioService             = usuarioService;
     _horarioSalaService         = horarioSalaService;
     _codigoInfravermelhoService = codigoInfravermelhoService;
 }
 public ReservaSalaController(
     ISalaService salaService,
     IUsuarioService usuarioService,
     IBlocoService blocoService,
     IUsuarioOrganizacaoService usuarioOrganizacaoService,
     IOrganizacaoService organizacaoService,
     IHorarioSalaService horarioSalaService,
     IHardwareDeSalaService hardwareDeSalaService
     )
 {
     _salaService               = salaService;
     _usuarioService            = usuarioService;
     _blocoService              = blocoService;
     _usuarioOrganizacaoService = usuarioOrganizacaoService;
     _organizacaoService        = organizacaoService;
     _horarioSalaService        = horarioSalaService;
     _hardwareDeSalaService     = hardwareDeSalaService;
 }
        public EquipamentoController(
            IEquipamentoService equipamentoService,
            ICodigoInfravermelhoService codigoInfravermelhoService,
            ISalaService salaService,
            IOperacaoCodigoService operacaoService,
            IUsuarioService usuarioService,
            IUsuarioOrganizacaoService usuarioOrganizacaoService,
            IBlocoService blocoService,
            IOrganizacaoService organizacaoService,
            IHardwareDeSalaService hardwareDeSalaService

            )
        {
            _equipamentoService         = equipamentoService;
            _codigoInfravermelhoService = codigoInfravermelhoService;
            _salaService               = salaService;
            _operacaoService           = operacaoService;
            _usuarioService            = usuarioService;
            _usuarioOrganizacaoService = usuarioOrganizacaoService;
            _blocoService              = blocoService;
            _organizacaoService        = organizacaoService;
            _hardwareDeSalaService     = hardwareDeSalaService;
        }
예제 #19
0
        public UpdateSalaRequestValidator(ISalaService salaService)
        {
            RuleFor(r => r.Id)
            .Must(p =>
            {
                var sala = salaService.GetAsync(p).Result;
                return(sala != null);
            })
            .WithMessage(m => "Sala de Id " + m.Id + " não foi encontrada");

            RuleFor(r => r.Descricao)
            .Must(p => !string.IsNullOrEmpty(p.Trim())).WithMessage("Campo [descrição] não deve ser vazio")
            .Must((obj, p) =>
            {
                var salas = salaService.GetByDescricaoAsync(obj.Descricao).Result.ToList();
                if (salas.Where(w => w.Id != obj.Id).Count() > 0)
                {
                    return(false);
                }
                return(true);
            })
            .WithMessage(m => "A descrição \'" + m.Descricao + "\' já existe");
        }
예제 #20
0
 public RoomHandler(WebSocketConnectionManager webSocketConnectionManager, ISalaService salaService) : base(webSocketConnectionManager)
 {
     this.salaService = salaService;
 }
예제 #21
0
 public SessaoController(ISessaoService sessaoService, IFilmeService filmeService, ISalaService salaService)
 {
     this.sessaoService = sessaoService;
     this.filmeService  = filmeService;
     this.salaService   = salaService;
 }
예제 #22
0
 public SalaController(ISalaService salaService)
 {
     this.salaService = salaService;
 }
예제 #23
0
 public SalasController(ISalaService salaService,
                        IEquipamentoService equipamentoService)
 {
     _salaService        = salaService;
     _equipamentoService = equipamentoService;
 }
예제 #24
0
 public SalaController(ISalaService salaService, IMapper mapper)
 {
     this.salaService = salaService;
     this.mapper      = mapper;
 }
예제 #25
0
 public SalaController(ISalaService salaService)
 {
     _salaService = salaService;
 }
예제 #26
0
 public SalasController(ISalaService service)
 {
     svc = service;
 }
예제 #27
0
 public SalaAppService(ISalaService salaService) : base(salaService)
 {
 }
예제 #28
0
 public SalaServiceTest()
 {
     _salaRepo = Substitute.For <ISalaRepository>();
     _salaSvc  = new SalaService(_salaRepo);
 }
예제 #29
0
 public SalaController(ISalaService _salaService, ILogger <SalaController> _logger)
 {
     this.salaService = _salaService;
     this.logger      = _logger;
 }
 public SalaAppService(IMapper mapper, ISalaService salaService)
 {
     _mapper      = mapper;
     _salaService = salaService;
 }