Ejemplo n.º 1
0
        //private void escondeDivSubsidio(string tipo)
        //{
        //    if (tipo.Equals("Subsídio"))
        //        pPrincipal5.Visible = false;
        //}

        private async Task checkedAcordo(string tipo, long idCaso)
        {
            if ((tipo != null) && !tipo.Equals("Subsídio"))
            {
                Questao5Bll questao5Bll = new Questao5Bll();
                var         q           = await questao5Bll.readCheckAcordo(idCaso);

                if ((q != null) && q.AcordoPrevio == false)
                {
                    rbAcordoPrevio.SelectedValue = "0";

                    this.DataTentativa1 = q.DataTentativa1;
                    this.DataTentativa2 = q.DataTentativa2;
                    this.DataTentativa3 = q.DataTentativa3;
                    this.Hora1          = q.DataTentativa1.ToString();
                    this.Hora2          = q.DataTentativa2.ToString();
                    this.Hora3          = q.DataTentativa3.ToString();
                    this.ValorProposta1 = q.ValorProposta1;
                    this.ValorProposta2 = q.ValorProposta2;
                    this.ValorProposta3 = q.ValorProposta3;
                    //rfReclamacaoCliente.Enabled = false;
                    this.ValorPropostaAcordo = q.ValorPropostaAcordo;
                    this.Comentario1         = q.Comentario1;
                    this.Comentario2         = q.Comentario2;
                    this.Comentario3         = q.Comentario3;
                }
            }
            else
            {
                pPrincipal5.Visible = false;
            }
        }
Ejemplo n.º 2
0
        public async Task populaCampos(int FormularioId, string status, long idCaso, string tipoDemanda)
        {
            disabilitaCamposReabertura(status);
            await checkedAcordo(tipoDemanda, idCaso);

            if (pPrincipal5.Visible)
            {
                await carregaReclCliente();

                Questao5Bll questao5Bll = new Questao5Bll();
                var         q           = await questao5Bll.readAsync(FormularioId);

                if (q != null)
                {
                    ViewState["idQuestao"] = q.id;
                    this.DataTentativa1    = q.DataTentativa1;
                    this.DataTentativa2    = q.DataTentativa2;
                    this.DataTentativa3    = q.DataTentativa3;
                    this.Hora1             = q.DataTentativa1.ToString();
                    this.Hora2             = q.DataTentativa2.ToString();
                    this.Hora3             = q.DataTentativa3.ToString();
                    this.ValorProposta1    = q.ValorProposta1;
                    this.ValorProposta2    = q.ValorProposta2;
                    this.ValorProposta3    = q.ValorProposta3;
                    this.AcordoPrevio      = q.AcordoPrevio;
                    if (AcordoPrevio == true)
                    {
                        dvAcordoPrevio.Style.Add("display", "block");
                        reclClienteID.Style.Add("display", "block");
                        dvAcordoPrevio.Style.Add("display", "block");
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hide", "$('#UserControlQuestao3_4_pPrincipal4').hide();", true);
                    }
                    else
                    {
                        if (this.tipoFormulario == Convert.ToInt16(Util.TFormulario.AcordoPrevio))
                        {
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hide", "$('#UserControlQuestao6_pPrincipal6').hide();", true);
                        }
                        //else
                        //    rfReclamacaoCliente.Enabled = false;
                    }

                    this.ValorPropostaAcordo = q.ValorPropostaAcordo;
                    this.ReclamacaoCliente   = q.reclamacaoClienteId;

                    this.Comentario1 = q.Comentario1;
                    this.Comentario2 = q.Comentario2;
                    this.Comentario3 = q.Comentario3;
                }
            }
        }
Ejemplo n.º 3
0
        public void Salvar(int FormularioId)
        {
            try
            {
                if (FormularioId > 0)
                {
                    Questao5Bll questao5Bll = new Questao5Bll();
                    Questao5    q           = new Questao5();

                    q.id = Convert.ToInt32(ViewState["idQuestao"]);
                    IFormatProvider culture = new CultureInfo("pt-BR", true);
                    q.formularioId = FormularioId;
                    if (Util.ISDate(txtDataHorario1.Text))
                    {
                        q.DataTentativa1 = DateTime.ParseExact(txtDataHorario1.Text + " " + (txtHora1.Text.Length == 5 ? txtHora1.Text + ":00" : "00:00:00"), "dd/MM/yyyy HH:mm:ss", culture);
                    }
                    else
                    {
                        q.DataTentativa1 = null;
                    }
                    if (Util.ISDate(txtDataHorario2.Text))
                    {
                        q.DataTentativa2 = DateTime.ParseExact(txtDataHorario2.Text + " " + (txtHora2.Text.Length == 5 ? txtHora2.Text + ":00" : "00:00:00"), "dd/MM/yyyy HH:mm:ss", culture);
                    }
                    else
                    {
                        q.DataTentativa2 = null;
                    }
                    if (Util.ISDate(txtDataHorario3.Text))
                    {
                        q.DataTentativa3 = DateTime.ParseExact(txtDataHorario3.Text + " " + (txtHora3.Text.Length == 5 ? txtHora3.Text + ":00" : "00:00:00"), "dd/MM/yyyy HH:mm:ss", culture);
                    }
                    else
                    {
                        q.DataTentativa3 = null;
                    }

                    if (ddlReclamacaoCliente.SelectedValue != "0")
                    {
                        q.reclamacaoClienteId = Convert.ToInt32(ddlReclamacaoCliente.SelectedValue);
                    }
                    else
                    {
                        q.reclamacaoClienteId = null;
                    }

                    q.ValorProposta1      = txtValorProposta1.Text == "" ? 0 : Convert.ToDecimal(txtValorProposta1.Text.Replace("R$ ", ""));
                    q.ValorProposta2      = txtValorProposta2.Text == "" ? 0 : Convert.ToDecimal(txtValorProposta2.Text.Replace("R$ ", ""));
                    q.ValorProposta3      = txtValorProposta3.Text == "" ? 0 : Convert.ToDecimal(txtValorProposta3.Text.Replace("R$ ", ""));
                    q.ValorPropostaAcordo = txtValorPropostaAcordo.Text == "" ? 0 : Convert.ToDecimal(txtValorPropostaAcordo.Text.Replace("R$ ", ""));
                    q.AcordoPrevio        = rbAcordoPrevio.SelectedValue == "1" ? true : false;

                    if (q.AcordoPrevio == false)
                    {
                        q.reclamacaoClienteId = null;
                    }

                    q.Comentario1 = string.IsNullOrEmpty(txtComentario1.Text) ? null : txtComentario1.Text.TrimEnd();
                    q.Comentario2 = string.IsNullOrEmpty(txtComentario2.Text) ? null : txtComentario2.Text.TrimEnd();
                    q.Comentario3 = string.IsNullOrEmpty(txtComentario3.Text) ? null : txtComentario3.Text.TrimEnd();

                    questao5Bll.save(q);
                    ViewState["idQuestao"] = q.id;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }