Ejemplo n.º 1
0
        private Sessao CriaSessaoPelosCampos()
        {
            List <ContingenciaColateral> CCs = new List <ContingenciaColateral>();

            foreach (ListViewItem item in listViewCCSessao.Items)
            {
                long CCid = long.Parse(item.SubItems[1].Text);
                CCs.Add(ContingenciaColateralService.GetById(CCid));
            }

            Instrucao instrucao = null;

            if (!string.IsNullOrWhiteSpace(textInstrucao.Text))
            {
                instrucao = new Instrucao {
                    Texto = textInstrucao.Text
                };
                InstrucaoService.Salvar(instrucao);
            }

            Sessao sessao = new Sessao {
                Nome           = textBoxNomeSessao.Text,
                CCs            = CCs,
                OrdemAleatoria = checkBoxTentativasRand.Checked,
                CriterioAcertosConcecutivos = Convert.ToInt32(numericAcertosConsec.Value),
                CriterioNumeroTentativas    = Convert.ToInt32(numericNTentativas.Value),
                CriterioDuracaoSegundos     = Convert.ToInt32(numericDuracao.Value),
                Instrucao = instrucao
            };

            return(sessao);
        }
Ejemplo n.º 2
0
        private void CarregarInstrucao(long id)
        {
            Instrucao instrucao = InstrucaoService.GetById(id);

            textInstrucao.Text = instrucao.Texto;
        }