/// <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); } }
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; }