public CambiarPass(Aplicador ap, string user) { InitializeComponent(); this.ap = ap; this.user = user; this.Text += string.Format(" [{0}]", user); }
public CambiarPass(Aplicador ap) { InitializeComponent(); this.ap = ap; this.user = ap.User.Nombre; this.Text += string.Format(" [{0}]", user); }
public FormOutro(Form mother, Aplicador app) { InitializeComponent(); WindowState = FormWindowState.Maximized; App = app; Mother = mother; }
public FormPre(FormIntro mother, Aplicador app) { InitializeComponent(); WindowState = FormWindowState.Maximized; App = app; Mother = mother; UpdateInstructions(Preparador.ObterInstrucoes()); }
private void button1_Click(object sender, EventArgs e) { string nome; string teste; int idade; try { nome = textNome.Text; idade = int.Parse(textIdade.Text); if (comboOps.SelectedIndex < 0) { throw new TesteNaoSelecionadoException(); } teste = Cook.Caminhos[comboOps.SelectedIndex]; int minimum = Calculator.GetMinimumAge(Aplicador.ExtrairTabela(teste, "percentile")); // IDEA Mover essas funções para um local apropriado int maximum = Calculator.GetMaximumAge(Aplicador.ExtrairTabela(teste, "percentile")); if ((idade < minimum) || (idade > maximum)) { throw new IdadeInvalidaException(); } if (nome.Length < 1) { throw new CamposNaoPreenchidosException(); } } catch (FormatException fe) { MessageBox.Show("Digite uma idade válida.", "Aviso!"); return; } catch (IdadeInvalidaException iie) { MessageBox.Show("Idade fora dos padrões do teste.", "Aviso!"); return; } catch (CamposNaoPreenchidosException cnpe) { MessageBox.Show("Digite um nome para o participante.", "Aviso!"); return; } catch (TesteNaoSelecionadoException tnse) { MessageBox.Show("Escolha um teste.", "Aviso!"); return; } FormPre form = new FormPre(this, new Aplicador(nome, teste, idade)); form.Show(); this.Hide(); }
//Igual que arriba, este método recibe un método que agregará los elementos resultantes. public ListaDeEnteros Aplicar(Aplicador f) { ListaDeEnteros listaAux = new ListaDeEnteros(); foreach (int numero in lista) { listaAux.Agregar(f(numero)); } return(listaAux); }
public MainFormTA(Aplicador ap) { InitializeComponent(); this.ap = ap; f_usuarios = new FormUsuarios(this.ap); if (ap.User.Categoria == Categoria_Usuario.Aplicador) { this.administradorDeUsuariosToolStripMenuItem.Enabled = false; } Cargar_Pacientes(); }
public FormResultado(Form mother, Aplicador app) { Mother = mother; /* Não se esqueça de que o os labels de baixo estão invisíveis! */ string resultado = app.CalcularResultado(); app.RegistrarCronometro(); InitializeComponent(); WindowState = FormWindowState.Maximized; var stuff = resultado.Split('\t'); lblLevel.Text = stuff[0]; lblNoRespostasCorretas.Text = stuff[1]; lblResultado.Text = stuff[2]; }
public static string[] GerarTabela(Aplicador app) { // Preparando variáveis auxiliares string dadosPuros = CamadaAcessoDados.Tudo(CamadaAcessoDados.GerarPadraoPeloTeste(app.NomeTeste)); var tempos = app.Tempos.Select((it) => it.ToString()).ToArray(); var resultado = app.CalcularResultado().Split('\t'); var validades = app.ChecarValidade(Preparador.ExtrairTabela(dadosPuros, "validity"), Preparador.ExtrairTabela(dadosPuros, "percentile")); // Construindo colunas com itens repetidos var dados = new Dictionary <string, string[]>(); int limite = app.OpcoesCorretas.Length; var name = new string[limite]; var age = new string[limite]; var initial = new string[limite]; var percentile = new string[limite]; var correct = new string[limite]; var incorrect = new string[limite]; var validity = new string[limite]; for (int i = 0; i < limite; ++i) { name[i] = app.NomeSujeito; age[i] = app.Idade.ToString(); percentile[i] = app.Percentil.ToString(); correct[i] = app.NoRespostasCorretas.ToString(); incorrect[i] = (app.Respostas.Count - app.NoRespostasCorretas).ToString(); validity[i] = validades[app.Series[i]]; initial[i] = app.MomentoInicial; } // Preparando colunas dados["name"] = name; dados["age"] = age; dados["initial"] = initial; dados["percentile"] = percentile; dados["correct"] = correct; dados["incorrect"] = incorrect; dados["expected"] = app.OpcoesCorretas.Select((it) => it.ToString()).ToArray(); dados["answers"] = app.Respostas.Select((it) => it.ToString()).ToArray(); dados["times"] = tempos; dados["validity"] = validity; // Salvando dados na memória string titulo = "Nome;Idade;Momento Inicial;Percentil;# Respostas Corretas;# Respostas Incorretas;Resposta esperada;Resposta dada;Tempos;Validez"; return(Formatar(titulo, dados)); }
static void RunWithEvaluator(string tag, int[] test) { Console.WriteLine($"--- # Testing {tag} test"); App = new Aplicador($"lil {tag} one", "cor", 5); App.PrepararTeste(); Console.WriteLine($"Nome: {App.NomeSujeito}"); for (var i = 0; i < App.ObterTamanhoDoTeste(); ++i) { App.Apresentar(i); var resposta = test[i]; App.OuvirResposta(i, resposta); } Console.WriteLine("# Assessing results"); Eval = new Avaliador(App); Console.WriteLine($"Percentil: {Eval.Percentil}"); Console.WriteLine(); App.RegistrarCronometro(); }
public CambiarCategoria(Aplicador ap, string user) { InitializeComponent(); this.ap = ap; this.user = user; Categoria_Usuario cat = ap.categoria(user); this.Text += string.Format(" [{0}]", user); switch (cat) { case Categoria_Usuario.Administrador: this.radioButtonAdmin.Checked = true; break; default: this.radioButtonApp.Checked = true; break; } }
public MainForm() { sp = new SplashVinci(); InitializeComponent(); this.comboBoxPrueba.SelectedIndex = 0; this.configDefaultLocation = new Point(11, 24); this.configWidth = 300; timer1.Start(); try { ap = new Aplicador(); Cargar_Pacientes(); } catch (Exception e) { MessageBox.Show(e.Message); } }
public EditPaciente(Aplicador ap, Opciones op, ListView l) { this.ap = ap; this.op = op; this.listViewPacientes = l; InitializeComponent(); this.buttonAction.Text = op.ToString(); this.cbLugar.Enabled = op != Opciones.Buscar; loadCombosAplicacion(); switch (op) { case Opciones.Agregar: this.Text = Resources.TITLE_AddPatient; break; case Opciones.Editar: { string codigo = this.listViewPacientes.SelectedItems[0].SubItems[1].Text; Paciente ale = ap.Obtener_Paciente(codigo); this.Text = string.Format("{0} [{1}]", Resources.TITLE_EditPatient, ale.Codigo); this.textBoxNombre.Text = ale.Nombre; this.textBoxApellido1.Text = ale.Apellido1; this.textBoxApellido2.Text = ale.Apellido2; this.textBoxCodigo.Text = ale.Codigo; this.textBoxCodigo.ReadOnly = true; this.domainUpDownSexo.Text = ale.Sexo.ToString(); this.dtpFechaNacimiento.Value = ale.Fecha_Nacimiento; this.textBoxDireccion.Text = ale.Direccion; this.textBoxNivel.Text = ale.Escolaridad; } break; default: this.linkLabel1.Visible = true; this.Text = Resources.ComboValue_ASS_Colores; this.textBoxCodigo.Enabled = true; break; } }
static void RunWithTest(string tag, int[] test) { Console.WriteLine($"--- # Testing {tag} test"); App = new Aplicador($"lil {tag} one", "cor", 10); App.PrepararTeste(); Console.WriteLine($"Nome: {App.NomeSujeito}"); Console.WriteLine($"Idade: {App.Idade}"); //Console.WriteLine("Momento inicial: " + App.MomentoInicial); //Console.WriteLine("Respostas dadas:"); Console.WriteLine($"Tamanho do teste: {App.ObterTamanhoDoTeste()}"); for (var i = 0; i < App.ObterTamanhoDoTeste(); ++i) { App.Apresentar(i); var resposta = test[i]; //Console.WriteLine("- " + resposta); App.OuvirResposta(i, resposta); } Console.WriteLine("# Assessing results"); Console.WriteLine($"Resultado calculado: {App.CalcularResultado()}"); Console.WriteLine($"Percentil: {App.Percentil}"); Console.WriteLine("No Respostas corretas: " + App.NoRespostasCorretas); Console.WriteLine(); App.RegistrarCronometro(); }
public Autent_User(Aplicador ap) { InitializeComponent(); this.textBox1.Focus(); this.ap = ap; }
public AddUser(Aplicador ap, ListView list) { InitializeComponent(); this.listViewUser = list; this.ap = ap; }
public FormPacientes(Aplicador ap, ComboBox comboBoxPaciente) { InitializeComponent(); this.adminPacientesUC1.Aplicador = ap; this.adminPacientesUC1.ComboBoxPaciente = comboBoxPaciente; }
public int CalcularCustoExame() => Aplicador.CalcularSalarioExame(this);
public FormOps(FormIntro mother, Aplicador app) : this(mother) { this.App = app; }
public HelpForm(Aplicador ap) { InitializeComponent(); this.aplicador = ap; }
public Autent_User() { InitializeComponent(); this.AP = new Aplicador(); this.textBox1.Focus(); }
public FormUsuarios(Aplicador ap) { InitializeComponent(); this.adminUsersUC1.Aplicador = ap; }
public void ToPublish(Aplicador ap, string TestCode) { this.richTextBoxConf.Rtf = ap.XmlInfo.GetInfoToPublish(TestCode, InfoClass.Configuracion); this.richTextBoxDesc.Rtf = ap.XmlInfo.GetInfoToPublish(TestCode, InfoClass.Descripcion); this.richTextBoxResult.Rtf = ap.XmlInfo.GetInfoToPublish(TestCode, InfoClass.Resultados); }