Exemplo n.º 1
0
    private void ProcessarDataBind(CliforDAO objCliente)
    {
        if (!Page.IsPostBack)
        {
            if (objCliente.RegistroAtual != null)
            {
                DataRow registroClifor = objCliente.RegistroAtual;
                lblCdClifor.Text = registroClifor["CD_CLIFOR"].ToString();

                CarregarValoresCamposLista();
                cbxCidades.LimparValores(Session);
                cbxCidades.SelectedValue = null;
                cbxCidades.DataSource = null;
                cbxCidades.DataBind();
                objCliente.PreencherComponentesComValoresBanco(this);

                CarregaCidades();
                cbxCidades.SetValor(registroClifor["NM_CIDNOR"].ToString());
                cbxCidades.DataBind();

                cbxStPessoaJ_SelectedIndexChanged(null, null);

                if (txtNumero.GetValor().ToString().Equals(""))
                {
                    txtNumero.SetValor("S/N");
                }
            }
        }
    }
Exemplo n.º 2
0
 private bool ExecutaPosvalidaCad(CliforDAO objCliente, bool bIncluindo)
 {
     bool bRetorno = objCliente.ProcessarPosvalidaCad();
     string sCdClifor = objCliente.GetValorPrimario("CD_CLIFOR");
     if (bRetorno)
     {
         if (!bIncluindo)
         {
             MessageHLP.ShowPopUpMsg(string.Format("Dados do Cliente {0}, foram alterados com sucesso! {1}Código: {2}", txtNmGuerra.GetValor(), Environment.NewLine, sCdClifor), this.Page);
         }
         else
         {
             MessageHLP.ShowPopUpMsg(string.Format("Cliente {0} salvo com sucesso! {1}Código: {2}", txtNmGuerra.GetValor(), Environment.NewLine, sCdClifor), this.Page);
         }
         objCliente.ClearComponentes(this);
         Response.Redirect("~/PesquisarClientes.aspx?CD_CLIFOR=" + sCdClifor.ToString());
     }
     else
     {
         MessageHLP.ShowPopUpMsg(objCliente.GetErros(), this.Page);
     }
     return bRetorno;
 }
Exemplo n.º 3
0
 private void GravarClienteIncluido(CliforDAO objCliente)
 {
     objCliente.SetValoresRegistroAtual(this);
     bool bContinua = ExecutaPosvalidaCad(objCliente, true);
     if (bContinua)
     {
         objCliente.RegistroAtual = null;
         btnConfirmar.Text = "Confirmar";
     }
 }
Exemplo n.º 4
0
    private bool ExecutaPosvalidaCad(CliforDAO objCliente, bool bIncluindo)
    {
        bool bRetorno = objCliente.ProcessarPosvalidaCad();
        string sCdClifor = objCliente.GetValorPrimario("CD_CLIFOR");
        if (bRetorno)
        {
            if (!bIncluindo)
            {
                if (lblCdClifor.Text != "")
                {
                    Session["CD_ALTER"] = lblCdClifor.Text;
                }
                MessageHLP.ShowPopUpMsg(string.Format("Dados do Cliente {0}, foram alterados com sucesso! {1}Código: {2}", txtNmGuerra.GetValor(), Environment.NewLine, Session["CD_ALTER"].ToString()), this.Page);
            }
            else
            {
                UsuarioWeb objUsuario = (UsuarioWeb)Session["ObjetoUsuario"];
                Session["CD_ALTER"] = objUsuario.oTabelas.hlpDbFuncoes.qrySeekValue("CLIFOR", "FIRST 1 CD_CLIFOR", string.Format("nm_clifor = '{0}' AND nm_guerra = '{1}'", this.txtNmClifor.GetValor(), this.txtNmGuerra.GetValor()));

                MessageHLP.ShowPopUpMsg(string.Format("Cliente {0} salvo com sucesso! {1}Código: {2}", txtNmGuerra.GetValor(), Environment.NewLine, Session["CD_ALTER"].ToString()), this.Page);
            }
            objCliente.ClearComponentes(this);
            Response.Redirect("~/PesquisarClientes.aspx?CD_ALTER=" + Session["CD_ALTER"].ToString());
        }
        else
        {
            MessageHLP.ShowPopUpMsg(objCliente.GetErros(), this.Page);
        }
        return bRetorno;
    }