示例#1
0
        private void ButtonSelecioarSessao_Click(object sender, EventArgs e)
        {
            if (listViewSessoes.SelectedItems.Count == 0)
            {
                MessageBox.Show("Nenhuma sessão selecionada/cadastrada!", "Advertência");
                return;
            }

            long   id     = ViewUtils.GetIdSelecionadoInListView(listViewSessoes);
            Sessao sessao = SessaoService.GetById(id);

            textBoxNomeSessao.Text         = sessao.Nome;
            numericAcertosConsec.Value     = sessao.CriterioAcertosConcecutivos;
            numericDuracao.Value           = sessao.CriterioDuracaoSegundos;
            numericNTentativas.Value       = sessao.CriterioNumeroTentativas;
            checkBoxTentativasAgrp.Checked = !sessao.OrdemAleatoria;
            checkBoxTentativasRand.Checked = sessao.OrdemAleatoria;

            if (sessao.Instrucao != null)
            {
                textInstrucao.Text = sessao.Instrucao.Texto;
            }

            listViewCCSessao.Items.Clear();
            foreach (ContingenciaColateral CC in sessao.CCs)
            {
                ListViewItem itemCC = new ListViewItem(CC.Nome);
                itemCC.SubItems.Add(CC.Id.ToString());
                listViewCCSessao.Items.Add(itemCC);
            }
        }
示例#2
0
        private void ButtonIniciar_Click(object sender, EventArgs e)
        {
            if (listViewsessoesExecutadas.Items.Count == 0)
            {
                MessageBox.Show("Por favor, selecione pelo menos uma Sessão para executar!", "Advertência");
                return;
            }

            List <Sessao> sessoes = new List <Sessao>();

            foreach (ListViewItem sessao in listViewsessoesExecutadas.Items)
            {
                sessoes.Add(SessaoService.GetById(long.Parse(sessao.SubItems[1].Text)));
            }
            Experimentador experimentador = CriaExperimentadorPelosCampos();
            Participante   participante   = CriarParticipantePelosCampos();

            TelaMensagem background = new TelaMensagem("");

            background.BackColor = Color.White;
            background.Show();

            new TelaExperimento(sessoes, experimentador, participante).ShowDialog();
            background.Close();
        }
        // [EnableCors(origins: "http://localhost:3000", headers: "*", methods: "GET, POST, PUT, DELETE, OPTIONS")]

        public IActionResult Cadastro1(Sessao s)
        {
            SessaoService sessaoService = new SessaoService();

            sessaoService.Inserir(s);
            return(RedirectToAction("Listagem"));
        }
示例#4
0
        private void ButtonCadastrarSessao_Click(object sender, EventArgs e)
        {
            Sessao sessao = CriaSessaoPelosCampos();

            SessaoService.Salvar(sessao);

            ListViewItem itemSessao = new ListViewItem(sessao.Nome);

            itemSessao.SubItems.Add(sessao.Id.ToString());
            listViewSessoes.Items.Add(itemSessao);
        }
示例#5
0
        public MenuInicial()
        {
            InitializeComponent();

            List <ContingenciaInstrucional> CIs = ContingenciaInstrucionalService.GetAll();
            List <ContingenciaColateral>    CCs = ContingenciaColateralService.GetAll();
            List <Sessao> sessoes = SessaoService.GetAll();

            comboBoxSexo.Items.AddRange(ESexo.Values());
            comboBoxEscolaridade.Items.AddRange(EEscolaridade.Values());
            comboBoxCI.Items.AddRange(CIs.Cast <object>().ToArray());
            comboBoxCI.DisplayMember = "Nome";
            comboBoxCC.Items.AddRange(CCs.Cast <object>().ToArray());
            comboBoxCC.DisplayMember = "Nome";

            listViewCI.Items.AddRange(CIs.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            listViewCC.Items.AddRange(CCs.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            listViewSessoes.Items.AddRange(sessoes.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            Image pactolo = new Bitmap(Pactolo.Properties.Resources.Pactolo);

            picturePactolo.Image = ImageUtils.Resize(pactolo, picturePactolo.Width, picturePactolo.Height);

            if (this.Width > width)
            {
                this.Width = width;
            }
            if (this.Height + 70 > height)
            {
                this.Height = height - 70;
            }
        }
示例#6
0
        private void ButtonExcluirSessao_Click(object sender, EventArgs e)
        {
            if (listViewSessoes.SelectedItems.Count == 0)
            {
                MessageBox.Show("Nenhuma sessão selecionada/cadastrada!", "Advertência");
                return;
            }

            long   id     = ViewUtils.GetIdSelecionadoInListView(listViewSessoes);
            Sessao sessao = SessaoService.GetById(id);

            SessaoService.Deletar(sessao);

            listViewSessoes.Items.Remove(listViewSessoes.SelectedItems[0]);
            ListViewItem[] sessaoExecutada = listViewsessoesExecutadas.Items.Find(sessao.Nome, false);
            if (sessaoExecutada.Length != 0)
            {
                listViewsessoesExecutadas.Items.Remove(sessaoExecutada[0]);
            }
        }
 public SessaoController(IConfiguration configuration)
 {
     _configuration = configuration;
     _service       = new SessaoService(_configuration.GetConnectionString("DefaultConnection"));
 }