private void PreencheFeedBack() { try { if (Program.CodigoEntrevista > 0) { DataTable tableTRepostaFeed1 = ControllerResposta.SelecioneRespostaFeedBack(Program.CodigoEntrevista, (int)CodigoPergunta.FEEDBACKABA1); if (tableTRepostaFeed1.Rows.Count == 1) { int feed = Convert.ToInt32(tableTRepostaFeed1.Rows[0]["CodigoOpcao"].ToString()); PreencheABA1(feed); } DataTable tableTRepostaFeed2 = ControllerResposta.SelecioneRespostaFeedBack(Program.CodigoEntrevista, (int)CodigoPergunta.FEEDBACKABA2); if (tableTRepostaFeed2.Rows.Count == 1) { int opcao = Convert.ToInt32(tableTRepostaFeed2.Rows[0]["CodigoOpcao"].ToString()); int subopcao = Convert.ToInt32(tableTRepostaFeed2.Rows[0]["CodigoSeqResposta"].ToString()); string textosub = tableTRepostaFeed2.Rows[0]["TextoSubResposta"].ToString(); PreencheABA2(opcao, subopcao, textosub); } } } catch (Exception ex) { throw ex; } }
private void btnSalvar_Click(object sender, EventArgs e) { try { if (Program.CodigoEntrevista > 0) { MostraCursor.CursorAguarde(true); ValidarCampos(); MapearCamposTResposta(); if (ControllerResposta.SalvarFeedBack(DadosTResposta)) { MapearCamposTEntrevista(); DadosTEntrevista.Completa = true; ControllerEntrevista.AtualizarEntrevista(dadosTEntrevista); MostraCursor.CursorAguarde(false); CaixaMensagem.ExibirOk("Formulário concluído com sucesso!"); Program.CodigoEntrevista = 0; this.Close(); } else { MostraCursor.CursorAguarde(false); CaixaMensagem.ExibirOk("Erro ao salvar o FeedBack!"); } } } catch (Exception ex) { MostraCursor.CursorAguarde(false); CaixaMensagem.ExibirOk(ex.Message); LogErro.GravaLog("Erro ao Salvar.", ex.Message); } }