public RelatorioViewModel(IUsuarioRepositorio usuarioRepository, ITipoIntervaloRepository tipoIntervaloRepository, RelatorioService relatorioService, IUnitOfWork unitOfWork) { this.usuarioRepository = usuarioRepository; this.tipoIntervaloRepository = tipoIntervaloRepository; this.relatorioService = relatorioService; this.Funcionarios = usuarioRepository.findFuncionarios(); this.FuncionarioEscolhido = Funcionarios.FirstOrDefault(); var today = DateTime.Today; this.PeriodoInicio = new DateTime(today.Year, today.Month, 1); this.PeriodoFim = PeriodoInicio.AddMonths(1).AddDays(-1); this.ExibirCommand = new RelayCommand(exibir); this.ExportarCommand = new RelayParameterCommand <string>(exportarExcel); this.ExibirPontoCommand = new RelayCommand(exibirPonto); this.unitOfWork = unitOfWork; unitOfWork.openConnection(); }
public ControleFolgaViewModel(IUsuarioRepositorio usuarioRep, RelatorioService relatorioService, PontoService pontoService, IUnitOfWork unitOfWork) { this.usuarioRepository = usuarioRep; this.relatorioService = relatorioService; this.pontoService = pontoService; base.unitOfWork = unitOfWork; var today = DateTime.Today; this.PeriodoInicio = new DateTime(today.Year, today.Month, 1); this.PeriodoFim = PeriodoInicio.AddMonths(1).AddDays(-1); this.Funcionarios = usuarioRepository.findFuncionarios().OrderBy(x => x.Nome).ToList(); this.FuncionarioEscolhido = Funcionarios[0]; diasAlterados = new List <DiaFolgaDTO>(); ExibirCommand = new RelayCommand(validarExibicao); SalvarCommand = new RelayCommand(confirmarSalvar, podeSalvar); FecharCommand = new RelayCommand(() => requestView(CLOSE)); unitOfWork.openConnection(); }