private void MostraRegistroAtivo() { chkHtonico.Checked = ativo.heterotonico; chkHsemantico.Checked = ativo.heterossemantico; chkHgenerico.Checked = ativo.heterogenerico; resP = Palavra.ConverteObject(crud.SelecionarTabela(tabelasBd.PALAVRA, Palavra.ToListTabela(true), "id=" + ativo.equivalente.ToString())); comboDestino.Text = resP.First().lema; txtApresentacao.Value = ativo.nOrdem; txtExemplo.Text = ativo.exemplo; txtExemploTraduzido.Text = ativo.exemplo_traduzido; resRef = Referencia.ConverteObject(crud.SelecionarTabela(tabelasBd.REFERENCIAS, Referencia.ToListTabela(true), "Id=" + ativo.Referencia.ToString())); if (resRef.Count > 0) { comboRef.Text = resRef.First().descricao; } resRubrica = MarcaUso.ConverteObject(crud.SelecionarTabela(tabelasBd.MARCAS_USO, MarcaUso.ToListTabela(true), "Id=" + ativo.MarcaUso.ToString())); if (resRubrica.Count > 0) { ComboRubrica.Text = resRubrica.First().descricao; } oldEqAt = ativo; txtCultura.Text = ativo.notasCulturais; txtGramatica.Text = ativo.notasGramaticais; }
private void btnProximo_Click(object sender, EventArgs e) { if (regsAtivo && posLista < equivO.Count) { ativo = equivO.ElementAt(++posLista); } if (!regsAtivo && posLista < equivD.Count) { ativo = equivD.ElementAt(++posLista); } MostraRegistroAtivo(); }
private void btnUltimo_Click(object sender, EventArgs e) { if (regsAtivo && posLista < equivO.Count) { ativo = equivO.Last(); posLista = equivO.Count - 1; } if (!regsAtivo && posLista < equivD.Count) { ativo = equivD.Last(); posLista = equivD.Count - 1; } MostraRegistroAtivo(); }
private void btnVisao_Click(object sender, EventArgs e) { if (regsAtivo) { regsAtivo = false; ativo = equivD.First(); btnVisao.Text = "Mostrar ativos"; } else { regsAtivo = true; ativo = equivO.First(); btnVisao.Text = "Mostrar estrangeiros"; } MostraRegistroAtivo(); }
private void btnAnterior_Click(object sender, EventArgs e) { if (posLista > 0) { posLista--; if (regsAtivo) { ativo = equivO.ElementAt(posLista); } else { ativo = equivD.ElementAt(posLista); } MostraRegistroAtivo(); } }
private void btnPrimeiro_Click(object sender, EventArgs e) { if (posLista > 0) { posLista = 0; if (regsAtivo) { ativo = equivO.First(); } else { ativo = equivD.First(); } MostraRegistroAtivo(); } }
private void btnProximo_Click(object sender, EventArgs e) { if (regsAtivo) { if (posLista < (equivO.Count - 1)) { ativo = equivO.ElementAt(++posLista); } } else { if (posLista < (equivD.Count - 1)) { ativo = equivD.ElementAt(++posLista); } } MostraRegistroAtivo(); }
private void btnSalva_Click(object sender, EventArgs e) { if (equivDestModificado || ativo.equivalente < 1) { if (novo) { InformaDiag.Erro("Selecione uma palavra equivalente dentro dos\nresultados da caixa de pesquisa Verbete Destino!"); return; } else { if (InformaDiag.ConfirmaSN("O valor selecionado no verbete destino foi modificado para um valor inconsistente.\nDeseja continuar com o valor antigo?") == DialogResult.No) { return; } } } ativo.exemplo = txtExemplo.Text; ativo.exemplo_traduzido = txtExemploTraduzido.Text; ativo.DefinirOrdemApresentação((int)txtApresentacao.Value); ativo.heterogenerico = chkHgenerico.Checked; ativo.heterotonico = chkHtonico.Checked; ativo.heterossemantico = chkHsemantico.Checked; ativo.notasCulturais = txtCultura.Text; ativo.notasGramaticais = txtGramatica.Text; if (!novo) { crud.UpdateLine(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), ativo.ToListValores(), "Origem=" + oldEqAt.origem.ToString() + " AND equivalente=" + oldEqAt.equivalente.ToString() + " AND nApresentacao=" + oldEqAt.nOrdem.ToString()); int tpos = equivO.IndexOf(ativo); equivO.RemoveAt(tpos); equivO.Insert(tpos, ativo); } else { crud.InsereLinha(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), ativo.ToListValores()); equivO.Add(ativo); if (equivO.Count > 1) { AtivaNavegadores(); } } InformaDiag.InformaSalvo(); novo = false; }
private void frm_Equivalente_Load(object sender, EventArgs e) { configuraLabelOrgiem(registroPai); equivO = Equivalente.ConverteObject(crud.SelecionarTabela(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), "Origem=" + registroPai.id.ToString(), "ORDER BY nApresentacao ASC")); //equivD = Equivalente.ConverteObject(crud.SelecionarTabela(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), "equivalente=" + registroPai.id.ToString())); if (equivO.Count > 0) { posLista++; btnPrimeiro_Click(sender, e); if (equivO.Count > 1) { AtivaNavegadores(); } } else { btnNovo_Click(sender, e); } }
private void btnSalva_Click(object sender, EventArgs e) { ativo.exemplo = txtExemplo.Text; ativo.exemplo_traduzido = txtExemploTraduzido.Text; ativo.DefinirOrdemApresentação((int)txtApresentacao.Value); ativo.PalavraGuia = txtGuia.Text; //ativo.heterogenerico = chkHgenerico.Checked; //ativo.heterotonico = chkHtonico.Checked; //ativo.heterossemantico = chkHsemantico.Checked; List <string> fld = Equivalente.ToListTabela(); fld.Remove("heterotonico"); fld.Remove("heterogenerico"); fld.Remove("heterossemantico"); if (!novo) { crud.UpdateLine(tabelasBd.EQUIVALENTE, fld, ativo.ToListValores(), "Origem=" + oldEqAt.origem.ToString() + " AND equivalente=" + oldEqAt.equivalente.ToString() + " AND nApresentacao=" + oldEqAt.nOrdem.ToString()); } else { if (ativo.equivalente < 1) { InformaDiag.Erro("Selecione um equivalente na lista de pesquisa."); return; } else { crud.InsereLinha(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), ativo.ToListValores()); equivO.Add(ativo); AtivaNavegadores(); } } InformaDiag.InformaSalvo(); novo = false; }
private string MontaApresentaçãoInfinitivoPt(Palavra pReg) { string pesquisa, textoApresentado = "Equivalências" + NOVALINHA; List <Equivalente> listaEquiv = new List <Equivalente>(); List <Palavra> listaPEquiv = new List <Palavra>(); List <ConjugacaoEn> listaConjugaEn = new List <ConjugacaoEn>(); pesquisa = "Origem=" + pReg.id.ToString(); listaEquiv = Equivalente.ConverteObject(cRUD.SelecionarTabela(tabelasBd.EQUIVALENTE, Equivalente.ToListTabela(), pesquisa, "ORDER BY nApresentacao ASC")); pesquisa = ""; foreach (Equivalente itemEquiv in listaEquiv) { pesquisa += ("id=" + itemEquiv.equivalente.ToString() + " OR "); } pesquisa = pesquisa.Remove(pesquisa.Count() - 4); listaPEquiv = Palavra.ConverteObject(cRUD.SelecionarTabela(tabelasBd.PALAVRA, Palavra.ToListTabela(true), pesquisa)); pesquisa = ""; foreach (Palavra p in listaPEquiv) { pesquisa += ("idconjugacao=" + p.id.ToString() + " OR "); } pesquisa = pesquisa.Remove(pesquisa.Count() - 4); listaConjugaEn = ConjugacaoEn.ConverteObject(cRUD.SelecionarTabela(tabelasBd.CONJUGACAOEN, ConjugacaoEn.ToListTabela(true), pesquisa)); int elementos = listaEquiv.Count; //monta Indice for (int i = 0; i < elementos; i++) { textoApresentado += ((i + 1).ToString() + ". " + (listaPEquiv.ElementAt(i).lema) + " (" + listaEquiv.ElementAt(i).PalavraGuia + ")" + NOVALINHA); } ConjugacaoEn conjugacao = new ConjugacaoEn(); for (int i = 0; i < elementos; i++) { pReg = listaPEquiv.ElementAt(i); conjugacao = listaConjugaEn.ElementAt(i); textoApresentado += ((i + 1).ToString() + ". " + (pReg.lema) + NOVALINHA); textoApresentado += (listaEquiv.ElementAt(i).PalavraGuia + NOVALINHA); textoApresentado += (pReg.Definicao + NOVALINHA); textoApresentado += (conjugacao.ConstrPresente + NOVALINHA); textoApresentado += (conjugacao.ConstrPassado + NOVALINHA); textoApresentado += (conjugacao.ConstrWill + NOVALINHA); textoApresentado += (conjugacao.ConstrGoingTo + NOVALINHA); textoApresentado += (conjugacao.ConstrPresPer + NOVALINHA); textoApresentado += (conjugacao.ConstrPasPer + NOVALINHA); textoApresentado += (conjugacao.ConstrPresCon + NOVALINHA); textoApresentado += (conjugacao.ConstrPasCon + NOVALINHA); textoApresentado += (conjugacao.ExPresente + NOVALINHA); textoApresentado += (conjugacao.ExPassado + NOVALINHA); textoApresentado += (conjugacao.ExWill + NOVALINHA); textoApresentado += (conjugacao.ExGoingTo + NOVALINHA); textoApresentado += (conjugacao.ExPresPer + NOVALINHA); textoApresentado += (conjugacao.ExPasPer + NOVALINHA); textoApresentado += (conjugacao.ExPresCon + NOVALINHA); textoApresentado += (conjugacao.ExPasCon + NOVALINHA); textoApresentado += (pReg.notas_gramatica + NOVALINHA); textoApresentado += (pReg.nota_cultura + NOVALINHA); } textoApresentado += ("Fraseologia" + NOVALINHA + NOVALINHA); return(textoApresentado); }