Esempio n. 1
0
        protected void btnConcluir_Click(object sender, EventArgs e)
        {
            AcordoPrevio a = new AcordoPrevio();

            a.preenchimentoCompleto = true;
            update(a);
        }
Esempio n. 2
0
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            AcordoPrevio a = new AcordoPrevio();

            a.preenchimentoCompleto = false;
            update(a);
        }
Esempio n. 3
0
 public void save(AcordoPrevio f)
 {
     if (f.id == 0)
     {
         acordoPrevioBll.create(f);
     }
     else
     {
         acordoPrevioBll.update(f);
     }
 }
Esempio n. 4
0
        private void update(AcordoPrevio a)
        {
            try
            {
                FormularioBll   formularioBll   = new FormularioBll();
                AcordoPrevioBll acordoPrevioBll = new AcordoPrevioBll();

                a.id              = string.IsNullOrEmpty(hfId.Value) ? 0 : Convert.ToInt32(hfId.Value);
                a.formularioId    = Convert.ToInt32(hfFormularioId.Value);
                a.questao_1       = rbQuestao_1.SelectedValue;
                a.obs_questao_1   = string.IsNullOrEmpty(txtObsQuestao_1.Text) ? null : txtObsQuestao_1.Text;
                a.questao_1_1     = rbQuestao_1_1_0.SelectedValue;
                a.obs_questao_1_1 = string.IsNullOrEmpty(txtObsQuestao_1_1.Text) ? null : txtObsQuestao_1_1.Text;
                a.questao_1_2     = rbQuestao_1_2_0.SelectedValue;
                a.obs_questao_1_2 = string.IsNullOrEmpty(txtObsQuestao_1_2.Text) ? null : txtObsQuestao_1_2.Text;
                a.questao_1_3     = rbQuestao_1_3_0.SelectedValue;
                a.obs_questao_1_3 = string.IsNullOrEmpty(txtObsQuestao_1_3.Text) ? null : txtObsQuestao_1_3.Text;
                a.questao_1_4     = rbQuestao_1_4_0.SelectedValue;
                a.obs_questao_1_4 = string.IsNullOrEmpty(txtObsQuestao_1_4.Text) ? null : txtObsQuestao_1_4.Text;
                a.obs_questao_2   = string.IsNullOrEmpty(txtObsQuestao_2.Text) ? null : txtObsQuestao_2.Text;
                a.obs_questao_3   = string.IsNullOrEmpty(txtObsQuestao_3.Text) ? null : txtObsQuestao_3.Text;
                a.obs_questao_4   = string.IsNullOrEmpty(txtObsQuestao_4.Text) ? null : txtObsQuestao_4.Text;
                a.questao_4       = rbQuestao_4.SelectedValue;
                a.obs_questao_5   = string.IsNullOrEmpty(txtObsQuestao_5.Text) ? null : txtObsQuestao_5.Text;
                a.questao_5       = rbQuestao_5.SelectedValue;
                a.obs_questao_6   = string.IsNullOrEmpty(txtObsQuestao_6.Text) ? null : txtObsQuestao_6.Text;
                a.questao_6       = rbQuestao_6.SelectedValue;
                a.obs_questao_7   = string.IsNullOrEmpty(txtObsQuestao_7.Text) ? null : txtObsQuestao_7.Text;
                a.questao_7       = rbQuestao_7.SelectedValue;
                a.consideracao    = string.IsNullOrEmpty(txtConsideracoesFinais.Text) ? null : txtConsideracoesFinais.Text;
                a.obs_questao_9   = string.IsNullOrEmpty(txtObsQuestao_9.Text) ? null : txtObsQuestao_9.Text;

                acordoPrevioBll.save(a);
                formularioBll.update(a.formularioId, UserControlHeader.linha, UserControlHeader.contrato, (a.preenchimentoCompleto == true ? true : false));

                UserControlExecQuestao1.Salvar(a.formularioId);

                if (UserControlQuestao3_4.panelPrincipal3.Visible)
                {
                    UserControlQuestao3_4.SaveQuestao3_4(a.formularioId);
                }

                if (UserControlQuestao5.panelPrincipal5.Visible)
                {
                    UserControlQuestao5.Salvar(a.formularioId);
                }

                if (UserControlQuestao6.panelPrincipal6.Visible)
                {
                    UserControlQuestao6.Salvar(a.formularioId);
                }

                UserControlQuestao7.Salvar(a.formularioId);

                UserControlFormularioAcordo.Salvar(a.formularioId);

                if (UserControlQuestao11.panelPrincipal11.Visible)
                {
                    UserControlQuestao11.Salvar(a.formularioId);
                }

                if (UserControlQuestao12.panelPrincipal12.Visible)
                {
                    UserControlQuestao12.Salvar(a.formularioId);
                }

                if (UserControlQuestao14.panelPrincipal14.Visible)
                {
                    UserControlQuestao14.Salvar(a.formularioId);
                }

                Util.Alertbootsrap("Dados atualizados", this, upSalvar);
            }
            catch (Exception ex)
            {
                Util.Alertbootsrap(string.Concat(ex.Message, " - ", ex.InnerException), this, upSalvar);
            }
        }