protected void Page_Load(object sender, EventArgs e)
        {
            bool exibeComboEntidade = true;

            if (param.ContainsKey("ent_idVisible"))
            {
                exibeComboEntidade = Convert.ToBoolean(param["ent_idVisible"].ToString());
            }
            UCComboEntidade1.Visible = exibeComboEntidade;

            if (!IsPostBack)
            {
                fdsResultados.Visible = false;

                try
                {
                    UCComboEntidade1.Inicialize("Entidade");
                    UCComboEntidade1._Load(Guid.Empty, 1);
                    UCComboEntidade1._EnableValidator = false;
                }
                catch (Exception err)
                {
                    if (SetLogErro != null)
                    {
                        SetLogErro(err);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string message = __SessionWEB.PostMessages;
            if (!String.IsNullOrEmpty(message))
            {
                _lblMessage.Text = message;
            }
            _uppCadastroSistema.Update();

            try
            {
                UCComboEntidade1.Inicialize("Entidade *");
                UCComboEntidade1._EnableValidator = true;
                UCComboEntidade1._Load(Guid.Empty, 0);
                UCComboEntidade1._ValidationGroup = "_vgCadastroSistemaEntidades";
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
                _uppCadastroSistema.Update();
            }

            if ((PreviousPage != null) && (PreviousPage.IsCrossPagePostBack))
            {
                //_txtsisnome.Enabled = false;
                _VS_sis_id = PreviousPage.EditItem_sis_id;
                _Carregar_dados();
            }
            else
            {
                _lblMessage.Text          = UtilBO.GetErroMessage("É necessário selecionar um sistema.", UtilBO.TipoMensagem.Alerta);
                _txtsisnome.Enabled       = false;
                _txtsiscaminho.Enabled    = false;
                _txturlintegracao.Enabled = false;

                _btnSalvar.Visible      = false;
                _btnAddEntidade.Enabled = false;

                _dgvSistemaEntidade.DataSource = new DataTable();
                _dgvSistemaEntidade.DataBind();
                _uppCadastroSistema.Update();

                this._btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
            }
            Page.Form.DefaultButton = _btnSalvar.UniqueID;
        }
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsEntidadesLigadas.js"));
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

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

        if (!IsPostBack)
        {
            string message = __SessionWEB.PostMessages;
            if (!String.IsNullOrEmpty(message))
            {
                _lblMessage.Text = message;
            }
            _dgvUsuario.PageSize = ApplicationWEB._Paginacao;

            try
            {
                string ent_padrao = __SessionWEB.__UsuarioWEB.Usuario.ent_id.ToString();
                if (!string.IsNullOrEmpty(ent_padrao))
                {
                    UCComboEntidade1._Combo.SelectedValue = ent_padrao;
                }

                UCComboEntidade1.Inicialize("Entidade");
                UCComboEntidade1._Load(Guid.Empty, 1);
                UCComboEntidade1._EnableValidator = false;
                if (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Administracao)
                {
                    UCComboEntidade1._Load(Guid.Empty, 0);
                }
                else
                {
                    UCComboEntidade1._LoadBy_UsuarioGrupoUA(Guid.Empty, __SessionWEB.__UsuarioWEB.Grupo.gru_id, __SessionWEB.__UsuarioWEB.Usuario.usu_id, 0);
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }

            VerificaBusca();

            _divConsulta.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar;
            _btnPesquisa.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar;
            _btnNovo.Visible     = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;

            Page.Form.DefaultButton = _btnPesquisa.UniqueID;
            Page.Form.DefaultFocus  = UCComboEntidade1._Combo.ClientID;
        }
    }
Esempio n. 4
0
 public void _CarregarComboEntidade(bool MostraSelecione)
 {
     UCComboEntidade1.Inicialize(true
                                 , "Entidade"
                                 , String.Format("Entidade é obrigatório.")
                                 , "*"
                                 , String.Empty
                                 , true
                                 , new UCComboSelectItemMessage("-- Selecione uma entidade --", "-1")
                                 , true
                                 , new UCComboItemNotFoundMessage("-- Selecione uma entidade --", "-1"));
     UCComboEntidade1._EnableValidator = true;
     UCComboEntidade1._ValidationGroup = "OrgaoSupervisao";
     UCComboEntidade1._Load(Guid.Empty, 0);
 }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.fdsResultados.Visible = false;

            UCComboEntidade1.Inicialize("Entidade");
            UCComboEntidade1._EnableValidator   = false;
            UCComboEntidade1._ShowSelectMessage = true;
            UCComboEntidade1._Load(Guid.Empty, 0);

            this.UCComboTipoUnidadeAdministrativa1._ShowSelectMessage = true;
            this.UCComboTipoUnidadeAdministrativa1._Load(new Guid(), 0);

            this._dgvUA.PageSize = ApplicationWEB._Paginacao;

            if (!string.IsNullOrEmpty(this.Request.QueryString["ent_idObrigatorio"]))
            {
                if (new Guid(this.Request.QueryString["ent_idObrigatorio"]) == Guid.Empty)
                {
                    this._lblMessage.Text = UtilBO.GetErroMessage("Selecione uma entidade na tela principal.", UtilBO.TipoMensagem.Alerta);
                    _btnPesquisar.Visible = false;
                }
                else
                {
                    UCComboEntidade1._Combo.SelectedValue = this.Request.QueryString["ent_idObrigatorio"];
                    _btnPesquisar.Visible = true;
                }

                UCComboEntidade1._Label.CssClass = "hide";
                UCComboEntidade1._Combo.CssClass = "hide";
            }

            if (this.Request["ent_id"] != null)
            {
                UCComboEntidade1._Combo.SelectedValue = this.Request["ent_id"].ToString();
            }

            if (this.Request["entEnabled"] != null)
            {
                if (!Convert.ToBoolean(this.Request["entEnabled"].ToString()))
                {
                    UCComboEntidade1._Label.CssClass = "hide"; // Visible = Convert.ToBoolean(this.Request["entEnabled"].ToString());
                    UCComboEntidade1._Combo.CssClass = "hide"; // Visible = Convert.ToBoolean(this.Request["entEnabled"].ToString());
                }
            }

            if (this.Request["tua_id"] != null)
            {
                UCComboTipoUnidadeAdministrativa1._Combo.SelectedValue = this.Request["tua_id"].ToString();
            }

            if (this.Request["tuaEnabled"] != null)
            {
                if (!Convert.ToBoolean(this.Request["tuaEnabled"].ToString()))
                {
                    UCComboTipoUnidadeAdministrativa1._Label.CssClass = "hide"; // Visible = Convert.ToBoolean(this.Request["entEnabled"].ToString());
                    UCComboTipoUnidadeAdministrativa1._Combo.CssClass = "hide"; // Visible = Convert.ToBoolean(this.Request["entEnabled"].ToString());
                }
            }
        }
    }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool exibeComboEntidade = true;

            if (param.ContainsKey("ent_idVisible"))
            {
                exibeComboEntidade = Convert.ToBoolean(param["ent_idVisible"].ToString());
            }
            UCComboEntidade1.Visible = exibeComboEntidade;

            bool exibeComboTipoUA = true;

            if (param.ContainsKey("tua_idVisible"))
            {
                exibeComboTipoUA = Convert.ToBoolean(param["tua_idVisible"].ToString());
            }
            UCComboTipoUnidadeAdministrativa1.Visible = exibeComboTipoUA;

            if (param.ContainsKey("gru_id") && param.ContainsKey("vis_id") && param.ContainsKey("usu_id"))
            {
                int vis_id = Convert.ToInt32(param["vis_id"].ToString());

                if (vis_id != SysVisaoID.Administracao)
                {
                    odsUA.SelectMethod = "GetSelectBy_PermissaoUsuario";
                }
            }

            if (!IsPostBack)
            {
                try
                {
                    fdsResultados.Visible = false;

                    UCComboEntidade1._EnableValidator   = false;
                    UCComboEntidade1._ShowSelectMessage = true;
                    UCComboEntidade1._Load(Guid.Empty, 0);

                    UCComboTipoUnidadeAdministrativa1._EnableValidator   = false;
                    UCComboTipoUnidadeAdministrativa1._ShowSelectMessage = true;
                    UCComboTipoUnidadeAdministrativa1._Load(Guid.Empty, 0);
                }
                catch (Exception err)
                {
                    if (SetLogErro != null)
                    {
                        SetLogErro(err);
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            if (exibeComboEntidade)
            {
                Page.Form.DefaultFocus = UCComboEntidade1._Combo.ClientID;
            }
            else if (exibeComboTipoUA)
            {
                Page.Form.DefaultFocus = UCComboTipoUnidadeAdministrativa1._Combo.ClientID;
            }
            else
            {
                Page.Form.DefaultFocus = _txtNome.ClientID;
            }

            Page.Form.DefaultButton = _btnPesquisar.UniqueID;
        }
    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));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsUCCadastroContato.js"));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsUCCadastroEndereco.js"));
            sm.Services.Add(new ServiceReference("~/WSServicos.asmx"));
        }

        UCComboTemaPadrao.IndexChanged += UCComboTemaPadrao_IndexChanged;

        if (!IsPostBack)
        {
            try
            {
                // Validação para utilização de múltiplos endereços para a entidade
                bool permitirMultiplosEnderecos = SYS_ParametroBO.ParametroValorBooleano(SYS_ParametroBO.eChave.PERMITIR_MULTIPLOS_ENDERECOS_ENTIDADE);
                UCEnderecos1.Inicializar(false, !permitirMultiplosEnderecos, "Entidade");

                UCComboTipoEntidade1.Inicialize("Tipo de entidade *");
                UCComboTipoEntidade1._EnableValidator = true;
                UCComboTipoEntidade1._ValidationGroup = "Endereco";
                UCComboTipoEntidade1._Load(0);

                UCComboTemaPadrao.Carregar();
                UCComboTemaPadrao_IndexChanged();

                if ((PreviousPage != null) && (PreviousPage.IsCrossPagePostBack))
                {
                    _VS_ent_id = PreviousPage.EditItem;

                    _LoadFromEntity();

                    _chkBloqueado.Visible  = true;
                    Page.Form.DefaultFocus = _txtRazaoSocial.ClientID;
                }
                else
                {
                    UCGridContato1._CarregarContato();

                    _chkBloqueado.Visible = false;
                    _chkBloqueado.Checked = false;

                    _VS_IsNew_end_id = true;

                    Page.Form.DefaultFocus  = UCComboTipoEntidade1._Combo.ClientID;
                    this._btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
                }

                UCComboEntidade1.Inicialize("Entidade superior");
                UCComboEntidade1._EnableValidator = false;
                UCComboEntidade1._Load(_VS_ent_id, 0);

                Page.Form.DefaultButton = _btnSalvar.UniqueID;
            }
            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.PastaScriptRaiz + "Telas/jsUCCadastroContato.js"));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsUCCadastroEndereco.js"));
            sm.Services.Add(new ServiceReference("~/WSServicos.asmx"));
        }

        if (!IsPostBack)
        {
            string ent_padrao = __SessionWEB.__UsuarioWEB.Usuario.ent_id.ToString();
            SetFocus(UCComboTipoUnidadeAdministrativa1);
            try
            {
                // Validação para utilização de múltiplos endereços para a unidade administrativa
                bool permitirMultiplosEnderecos = SYS_ParametroBO.ParametroValorBooleano(SYS_ParametroBO.eChave.PERMITIR_MULTIPLOS_ENDERECOS_UA);
                UCEnderecos1.Inicializar(false, !permitirMultiplosEnderecos, string.Empty);

                if (!string.IsNullOrEmpty(ent_padrao))
                {
                    _VS_ent_id = new Guid(ent_padrao);
                }

                UCComboEntidade1._ShowSelectMessage = true;
                if (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.Administracao)
                {
                    UCComboEntidade1._Load(Guid.Empty, 0);
                }
                else
                {
                    UCComboEntidade1._LoadBy_UsuarioGrupoUA(Guid.Empty, __SessionWEB.__UsuarioWEB.Grupo.gru_id, __SessionWEB.__UsuarioWEB.Usuario.usu_id, 0);
                }

                UCComboEntidade1.Inicialize("Entidade *");

                UCComboEntidade1._Combo.SelectedValue = string.IsNullOrEmpty(ent_padrao) ? Guid.Empty.ToString() : ent_padrao;

                UCComboTipoUnidadeAdministrativa1._ShowSelectMessage = true;
                UCComboTipoUnidadeAdministrativa1._Load(Guid.Empty, 0);
                UCComboTipoUnidadeAdministrativa1.Inicialize("Tipo de unidade administrativa *");

                if ((PreviousPage != null) && PreviousPage.IsCrossPagePostBack)
                {
                    _VS_ent_id = PreviousPage.EditItem_ent_id;
                    _VS_uad_id = PreviousPage.EditItem_uad_id;

                    _LoadFromEntity();

                    _chkBloqueado.Visible = true;

                    Page.Form.DefaultFocus = _txtNome.ClientID;
                }
                else
                {
                    UCGridContato1._CarregarContato();

                    _chkBloqueado.Visible = false;
                    _chkBloqueado.Checked = false;

                    _VS_IsNew_end_id = true;

                    Page.Form.DefaultFocus = UCComboEntidade1._Combo.ClientID;

                    this._btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
                }

                UCUASuperior.VsGruId = __SessionWEB.__UsuarioWEB.Grupo.gru_id;
                UCUASuperior.VsUsuId = __SessionWEB.__UsuarioWEB.Usuario.usu_id;
                UCUASuperior.VsVisId = __SessionWEB.__UsuarioWEB.Grupo.vis_id;

                Page.Form.DefaultButton = _btnSalvar.UniqueID;
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }
        }

        if (__SessionWEB.__UsuarioWEB.Grupo.vis_id == SysVisaoID.UnidadeAdministrativa)
        {
            UCComboEntidade1._Combo.Enabled = false;
        }

        Delegates();

        UCComboEntidade1.OnSelectedIndexChange += UCComboEntidade1__IndexChanged;
    }