protected void btnSalvar_Click(object sender, EventArgs e) { MigracaoIndevida f = new MigracaoIndevida(); f.preenchimentoCompleto = false; update(f); }
protected void btnConcluir_Click(object sender, EventArgs e) { MigracaoIndevida f = new MigracaoIndevida(); f.preenchimentoCompleto = true; update(f); }
public void save(MigracaoIndevida f) { if (f.id == 0) { migrIndevidaBll.create(f); } else { migrIndevidaBll.update(f); } }
private void update(MigracaoIndevida f) { try { FormularioBll formularioBll = new FormularioBll(); MigracaoIndevidaBLL migrIndevidaBll = new MigracaoIndevidaBLL(); f.id = string.IsNullOrEmpty(hfId.Value) ? 0 : Convert.ToInt32(hfId.Value); f.formularioId = Convert.ToInt32(hfFormularioId.Value); f.questao_1 = rbQuestao_1.SelectedValue; f.obs_questao_1 = string.IsNullOrEmpty(txtObsQuestao_1.Text) ? null : txtObsQuestao_1.Text; f.questao_1_1 = rbQuestao_1_1_0.SelectedValue; f.obs_questao_1_1 = string.IsNullOrEmpty(txtObsQuestao_1_1.Text) ? null : txtObsQuestao_1_1.Text; f.questao_1_2 = rbQuestao_1_2_0.SelectedValue; f.obs_questao_1_2 = string.IsNullOrEmpty(txtObsQuestao_1_2.Text) ? null : txtObsQuestao_1_2.Text; f.questao_1_3 = rbQuestao_1_3_0.SelectedValue; f.obs_questao_1_3 = string.IsNullOrEmpty(txtObsQuestao_1_3.Text) ? null : txtObsQuestao_1_3.Text; f.questao_1_4 = rbQuestao_1_4_0.SelectedValue; f.obs_questao_1_4 = string.IsNullOrEmpty(txtObsQuestao_1_4.Text) ? null : txtObsQuestao_1_4.Text; f.questao_2 = rbQuestao_2.Text; f.obs_questao_2 = string.IsNullOrEmpty(txtObsQuestao_2.Text) ? null : txtObsQuestao_2.Text; f.dtInsQuestao_3 = string.IsNullOrEmpty(txtDtInsQuestao_3.Text) ? (DateTime?)null : Convert.ToDateTime(txtDtInsQuestao_3.Text); f.obs_questao_3 = string.IsNullOrEmpty(txtObsQuestao_3.Text) ? null : txtObsQuestao_3.Text; f.dtMigracaoQuestao_4 = string.IsNullOrEmpty(txtDtMigracaoQuestao_4.Text) ? (DateTime?)null : Convert.ToDateTime(txtDtMigracaoQuestao_4.Text); f.obs_questao_4 = string.IsNullOrEmpty(txtObsQuestao_4.Text) ? null : txtObsQuestao_4.Text; f.questao_5 = rbQuestao_5.SelectedValue; f.obs_questao_5 = string.IsNullOrEmpty(txtObsQuestao_5.Text) ? null : txtObsQuestao_5.Text; f.questao_6 = rbQuestao_6.SelectedValue; f.obs_questao_6 = string.IsNullOrEmpty(txtObsQuestao_6.Text) ? null : txtObsQuestao_6.Text; f.questao_7 = rbQuestao_7.SelectedValue; f.obs_questao_7 = string.IsNullOrEmpty(txtObsQuestao_7.Text) ? null : txtObsQuestao_7.Text; f.questao_8 = rbQuestao_8.SelectedValue; f.obs_questao_8 = string.IsNullOrEmpty(txtObsQuestao_8.Text) ? null : txtObsQuestao_8.Text; f.questao_9 = rbQuestao_9.SelectedValue; f.obs_questao_9 = string.IsNullOrEmpty(txtObsQuestao_9.Text) ? null : txtObsQuestao_9.Text; f.questao_10 = rbQuestao_10.SelectedValue; f.obs_questao_10 = string.IsNullOrEmpty(txtObsQuestao_10.Text) ? null : txtObsQuestao_10.Text; f.questao_11 = rbQuestao_11.SelectedValue; f.obs_questao_11 = string.IsNullOrEmpty(txtObsQuestao_11.Text) ? null : txtObsQuestao_11.Text; f.questao_12 = rbQuestao_12.SelectedValue; f.obs_questao_12 = string.IsNullOrEmpty(txtObsQuestao_12.Text) ? null : txtObsQuestao_12.Text; f.questao_13 = rbQuestao_13.SelectedValue; f.obs_questao_13 = string.IsNullOrEmpty(txtObsQuestao_13.Text) ? null : txtObsQuestao_13.Text; f.questao_14 = rbQuestao_14.SelectedValue; f.obs_questao_14 = string.IsNullOrEmpty(txtObsQuestao_14.Text) ? null : txtObsQuestao_14.Text; f.questao_15 = rbQuestao_15.SelectedValue; f.obs_questao_15 = string.IsNullOrEmpty(txtObsQuestao_15.Text) ? null : txtObsQuestao_15.Text; f.questao_16 = rbQuestao_16.SelectedValue; f.obs_questao_16 = string.IsNullOrEmpty(txtObsQuestao_16.Text) ? null : txtObsQuestao_16.Text; f.consideracao = string.IsNullOrEmpty(txtConsideracoesFinais.Text) ? null : txtConsideracoesFinais.Text; f.obs_questao_18 = string.IsNullOrEmpty(txtObsQuestao_18.Text) ? null : txtObsQuestao_18.Text; migrIndevidaBll.save(f); formularioBll.update(f.formularioId, UserControlHeader.linha, UserControlHeader.contrato, (f.preenchimentoCompleto == true ? true : false)); UserControlExecQuestao1.Salvar(f.formularioId); if (UserControlQuestao3_4.panelPrincipal3.Visible) { UserControlQuestao3_4.SaveQuestao3_4(f.formularioId); } if (UserControlQuestao5.panelPrincipal5.Visible) { UserControlQuestao5.Salvar(f.formularioId); } if (UserControlQuestao6.panelPrincipal6.Visible) { UserControlQuestao6.Salvar(f.formularioId); } UserControlQuestao7.Salvar(f.formularioId); UserControlOcorrenciaNet.Salvar(f.formularioId); if (UserControlQuestao11.panelPrincipal11.Visible) { UserControlQuestao11.Salvar(f.formularioId); } if (UserControlQuestao12.panelPrincipal12.Visible) { UserControlQuestao12.Salvar(f.formularioId); } if (UserControlQuestao14.panelPrincipal14.Visible) { UserControlQuestao14.Salvar(f.formularioId); } Util.Alertbootsrap("Dados atualizados", this, upSalvar); } catch (Exception ex) { Util.Alertbootsrap(string.Concat(ex.Message, " - ", ex.InnerException), this, upSalvar); } }