protected override void viewRequested(object sender, framework.ViewRequestEventArgs e) { switch (e.RequestCode) { case PainelControleViewModel.VIEW_FERIADO: FeriadoWindowFactory.criarCadastroFeriadoWindow().ShowDialog(); break; case PainelControleViewModel.VIEW_FOLGA: PontoWindowFactory.criarFolgaWindow().ShowDialog(); break; case PainelControleViewModel.VIEW_JORNADA: JornadaWindowFactory.criarJornadaWindow().ShowDialog(); break; case PainelControleViewModel.VIEW_RELATORIO: RelatorioWindowFactory.criarRelatorioWindow().ShowDialog(); break; case PainelControleViewModel.VIEW_PONTO: PontoWindowFactory.criarControlarPontoWindow().ShowDialog(); break; default: base.viewRequested(sender, e); break; } }
protected override void viewRequested(object sender, ViewRequestEventArgs e) { switch (e.RequestCode) { case ControlarPontoViewModel.EDITAR_PONTO: var editEvent = e as EditarPontoEventArgs; PontoWindowFactory.criarPontoDoFuncionarioWindow(editEvent.DiaTrabalho, ViewModel.unitOfWork).ShowDialog(); break; default: base.viewRequested(sender, e); break; } }
protected override void viewRequested(object sender, framework.ViewRequestEventArgs e) { switch (e.RequestCode) { case RelatorioViewModel.VIEW_PONTO: var viewModel = ViewModel as RelatorioViewModel; var dia = (viewModel.DiaSelecionado.DiaRelatorio as IDiaComPonto).PontoDia as DiaTrabalho; PontoWindowFactory.criarPontoDoFuncionarioWindow(dia, viewModel.unitOfWork).ShowDialog(); break; default: base.viewRequested(sender, e); break; } }
protected override void viewRequested(object sender, framework.ViewRequestEventArgs e) { switch (e.RequestCode) { case SelecaoDataViewModel.PONTO_VIEW: var viewModel = ViewModel as SelecaoDataViewModel; PontoWindowFactory.criarPontoDoFuncionarioWindow(viewModel.DiaTrabalhoSelecionado, viewModel.unitOfWork).ShowDialog(); Close(); break; default: base.viewRequested(sender, e); break; } }
private void Application_Startup(object sender, StartupEventArgs e) { Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; tratarArgumentos(e.Args); bool loginAgain; do { loginAgain = false; var loginResult = UsuarioWindowFactory.criarLoginWindow().ShowDialog(); if (loginResult.HasValue && loginResult.Value) { loginAgain = true; try { if (SessaoLogin.getSessao().UsuarioLogado is Funcionario) { var pontoService = PontoServiceFactory.criarPontoService(); var ponto = recuperarOuIniciarPonto(pontoService); PontoWindowFactory.criarPontoWindow(ponto, pontoService).ShowDialog(); } else { PainelControleWindowFactory.criarPainelControleWindow().ShowDialog(); } } catch (PontoDiaJaExisteException ex) { MessageBox.Show(string.Format("O ponto do dia {0} já foi encerrado", ex.DataPonto.ToShortDateString()), "Não é possível iniciar", MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Não foi possível completar a operação", MessageBoxButton.OK, MessageBoxImage.Warning); } } SessaoLogin.getSessao().encerrar(); } while (loginAgain); Current.Shutdown(); }