예제 #1
0
 private void UCComboPais1__IndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (UCComboPais1._Combo.SelectedValue == SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.PAIS_PADRAO_BRASIL))
         {
             CarregaComboEstado();
         }
         else
         {
             UCComboUnidadeFederativa1.Inicialize(true
                                                  , "Estado"
                                                  , String.Format("Estado é obrigatório.")
                                                  , "*"
                                                  , String.Empty
                                                  , true
                                                  , new UCComboSelectItemMessage("-- Selecione um estado --", "-1")
                                                  , true
                                                  , new UCComboItemNotFoundMessage("-- Selecione um estado --", "-1"));
             UCComboUnidadeFederativa1._Combo.Enabled       = false;
             UCComboUnidadeFederativa1._EnableValidator     = false;
             UCComboUnidadeFederativa1._Combo.SelectedValue = Guid.Empty.ToString();
             _txtDDD.Text    = "";
             _txtCidade.Text = "";
             _txtCidade.Focus();
         }
     }
     catch (Exception ex)
     {
         ApplicationWEB._GravaErro(ex);
         _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
     }
 }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UtilBO.SetScriptBusca(Page, _btnNovo, new string[] { }, String.Concat(ApplicationWEB._DiretorioVirtual, "AreaAdm/Cidade/Cadastro.aspx?Pesquisar=", _btnPesquisar.ClientID), "Cadastro de cidade", 350, 250);
        UCComboPais1.OnSelectedIndexChange = UCComboPais1__IndexChanged;

        if (!IsPostBack)
        {
            UCComboPais1._ShowSelectMessage = true;
            UCComboPais1._Load(0);
            UCComboUnidadeFederativa1._ShowSelectMessage = true;
            UCComboUnidadeFederativa1._Load(Guid.Empty, 0);

            fdsResultados.Visible = false;

            string parametro = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.PAIS_PADRAO_BRASIL);
            if (!string.IsNullOrEmpty(parametro))
            {
                UCComboPais1._Combo.SelectedValue = parametro;
                _ChangeComboPais();
                _VS_pais_padrao = parametro;
                UCComboUnidadeFederativa1._Load(new Guid(parametro), 1);
                UCComboUnidadeFederativa1._Combo.Enabled = true;
            }
            else
            {
                UCComboUnidadeFederativa1._Combo.Enabled = false;
            }

            Page.Form.DefaultButton = _btnPesquisar.UniqueID;
            Page.Form.DefaultFocus  = UCComboPais1._Combo.ClientID;
        }
    }
예제 #3
0
 private void CarregaComboEstado()
 {
     UCComboUnidadeFederativa1.Inicialize(true
                                          , "Estado *"
                                          , String.Format("Estado é obrigatório.")
                                          , "*"
                                          , String.Empty
                                          , true
                                          , new UCComboSelectItemMessage("-- Selecione um estado --", "-1")
                                          , true
                                          , new UCComboItemNotFoundMessage("-- Selecione um estado --", "-1"));
     UCComboUnidadeFederativa1._Combo.Enabled   = true;
     UCComboUnidadeFederativa1._EnableValidator = true;
     UCComboUnidadeFederativa1._ValidationGroup = "vlgPais";
     UCComboUnidadeFederativa1._Combo.Focus();
 }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                fdsResultados.Visible = false;

                UCComboPais1._EnableValidator   = false;
                UCComboPais1._ShowSelectMessage = true;
                UCComboPais1._Load(0);

                UCComboUnidadeFederativa1._EnableValidator   = false;
                UCComboUnidadeFederativa1._ShowSelectMessage = true;
                UCComboUnidadeFederativa1._Load(Guid.Empty, 0);
                UCComboUnidadeFederativa1._Combo.Enabled = false;
            }

            UCComboPais1.OnSelectedIndexChange = UCComboPais1_OnSelectedIndexChange1;
        }
예제 #5
0
    /// <summary>
    /// Carrega combos da tela.
    /// </summary>
    public void CarregarCombos()
    {
        try
        {
            UCComboPais1.CancelaSelect = false;
            UCComboPais1.Inicialize(true
                                    , "País *"
                                    , String.Format("País é obrigatório.")
                                    , "*"
                                    , String.Empty
                                    , true
                                    , new UCComboSelectItemMessage("-- Selecione um país --", "-1")
                                    , true
                                    , new UCComboItemNotFoundMessage("-- Selecione um país --", "-1"));
            UCComboPais1._EnableValidator = true;
            UCComboPais1._ValidationGroup = "vlgPais";
            UCComboPais1._Load(0);
            UCComboPais1._Combo.SelectedValue = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.PAIS_PADRAO_BRASIL);



            UCComboUnidadeFederativa1.CancelarBinding = false;
            UCComboUnidadeFederativa1.Inicialize(true
                                                 , "Estado"
                                                 , String.Format("Estado é obrigatório.")
                                                 , "*"
                                                 , String.Empty
                                                 , true
                                                 , new UCComboSelectItemMessage("-- Selecione um estado --", "-1")
                                                 , true
                                                 , new UCComboItemNotFoundMessage("-- Selecione um estado --", "-1"));
            UCComboUnidadeFederativa1._EnableValidator = false;
            UCComboUnidadeFederativa1._ValidationGroup = "vlgPais";
            UCComboUnidadeFederativa1._Load(Guid.Empty, 0);
            UCComboUnidadeFederativa1._Combo.Enabled = false;

            CarregaComboEstado();
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
        }
    }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos));
        }

        if (!IsPostBack)
        {
            try
            {
                UCComboPais1.Inicialize("País *");
                UCComboPais1._EnableValidator = true;
                UCComboPais1._ValidationGroup = "vlgPais";
                UCComboPais1._Load(0);

                UCComboUnidadeFederativa1.Inicialize("Estado");
                UCComboUnidadeFederativa1._EnableValidator = true;
                UCComboUnidadeFederativa1._ValidationGroup = "vlgPais";
                UCComboUnidadeFederativa1._Load(Guid.Empty, 0);
                UCComboUnidadeFederativa1._Combo.Enabled = false;
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }

            _btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
            _Limpar();
            _lblMessage.Visible = false;

            Page.Form.DefaultFocus  = UCComboPais1._Combo.ClientID;
            Page.Form.DefaultButton = _btnSalvar.UniqueID;
        }

        UCComboPais1.OnSelectedIndexChange = UCComboPais1__IndexChanged;
    }