Esempio n. 1
0
    private void LoadFromEntity(Guid pes_id)
    {
        UCEnderecos1.Inicializar(true, false, "Endereco");

        //Carrega dados dos endereços da pessoa
        DataTable dtEndereco = PES_PessoaEnderecoBO.GetSelect(pes_id, false, 1, 1);

        UCEnderecos1.CarregarEnderecosBanco(dtEndereco);

        UCGridContato1._CarregarContato();
        UCGridDocumento1._CarregarDocumento(Guid.Empty);
        UCGridCertidaoCivil1._CarregarCertidaoCivil();
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.UiAriaTabs));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.Tabs));
            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("~/Includes/jsCadastroPessoa.js"));
            sm.Scripts.Add(new ScriptReference("~/Includes/jsUCCadastroEndereco.js"));
            sm.Scripts.Add(new ScriptReference("~/Includes/jsCadastroCertidaoCivil.js"));
            sm.Services.Add(new ServiceReference("~/WSServicos.asmx"));
        }

        if (!IsPostBack)
        {
            cvDataNascimento.ErrorMessage = GestaoEscolarUtilBO.RetornaMsgValidacaoData("Data de nascimento do aluno");
            CustomValidator1.ErrorMessage = GestaoEscolarUtilBO.RetornaMsgValidacaoData("Data de emissão da certidão de nascimento");

            string message = __SessionWEB.PostMessages;
            if (!String.IsNullOrEmpty(message))
            {
                lblMessage.Text = message;
            }

            lblMatriculaEstadual.Text         = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual() + " *";
            rfvMatriculaEstadual.ErrorMessage = GestaoEscolarUtilBO.nomePadraoMatriculaEstadual() + " é obrigatório.";

            UCComboTipoDeficiencia1._MostrarMessageSelecione = true;
            UCComboTipoDeficiencia1._Load(Guid.Empty, 0);

            UCEnderecos1.Inicializar(false, true, string.Empty);

            UCFiltroEscolas1.SelecionaCombosAutomatico             = false;
            UCFiltroEscolas1.UnidadeAdministrativaCampoObrigatorio = true;
            UCFiltroEscolas1.EscolaCampoObrigatorio = true;
            UCFiltroEscolas1._LoadInicial();

            UCComboCursoCurriculo1.Obrigatorio = true;
            UCComboCursoCurriculo1.CarregarCursoCurriculo();
            UCComboCursoCurriculo1.PermiteEditar = false;

            UCComboCurriculoPeriodo1._Label.Text += " *";
            UCComboCurriculoPeriodo1._MostrarMessageSelecione = true;
            UCComboCurriculoPeriodo1._Load(-1, -1);
            UCComboCurriculoPeriodo1._Combo.Enabled      = false;
            UCComboCurriculoPeriodo1.ExibeFormatoPeriodo = true;
            cvCurriculoPeriodo.ErrorMessage = GestaoEscolarUtilBO.nomePadraoPeriodo() + " é obrigatório.";

            try
            {
                if (__SessionWEB._cid_id != Guid.Empty)
                {
                    END_Cidade cid = new END_Cidade {
                        cid_id = __SessionWEB._cid_id
                    };
                    END_CidadeBO.GetEntity(cid);

                    _txtCid_id.Value     = cid.cid_id.ToString();
                    txtNaturalidade.Text = cid.cid_nome;

                    _txtCid_idCertidao.Value = cid.cid_id.ToString();
                    txtCidadeCertidao.Text   = cid.cid_nome;
                }
            }
            catch (Exception ex)
            {
                ApplicationWEB._GravaErro(ex);
                lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro);
            }

            UCGridContato1._CarregarContato();

            UCComboTipoDeficiencia1._Label.Text = "Necessidade educacional especial";
            UCComboEstadoCivil1._Label.Text     = "Estado civil *";
            UCComboRacaCor1._Label.Text         = "Raça / cor *";
            UCComboSexo1._Label.Text            = "Sexo *";

            UCComboEstadoCivil1._Combo.SelectedValue = "1";
            _ddlSituacao.SelectedValue = "1";

            Page.Form.DefaultFocus  = txtMatriculaEstadual.ClientID;
            Page.Form.DefaultButton = btnSalvarNovo.UniqueID;
            btnSalvarNovo.Visible   = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir;
        }

        UCFiltroEscolas1._Selecionar        += UCFiltroEscolas1__Selecionar;
        UCFiltroEscolas1._SelecionarEscola  += UCFiltroEscolas1__SelecionarEscola;
        UCComboCursoCurriculo1.IndexChanged += UCComboCursoCurriculo1_IndexChanged;
    }
    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);
            }
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this);

        if (sm != null)
        {
            sm.Scripts.Add(new ScriptReference(ArquivoJS.UiAriaTabs));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.Tabs));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsCadastroPessoa.js"));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsUCCadastroContato.js"));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsUCCadastroEndereco.js"));
            sm.Scripts.Add(new ScriptReference(ArquivoJS.PastaScriptRaiz + "Telas/jsCadastroCertidaoCivil.js"));
            sm.Services.Add(new ServiceReference("~/WSServicos.asmx"));
        }

        UCPessoas1.Paginacao     = ApplicationWEB._Paginacao;
        UCPessoas1.ContainerName = "divBuscaPessoa";
        UCPessoas1.ReturnValues += UCPessoas1BuscaPessoa;

        if (!IsPostBack)
        {
            // Inicializa componentes

            // Validação para utilização de múltiplos endereços para a manutenção de pessoas
            bool permitirMultiplosEnderecos = SYS_ParametroBO.ParametroValorBooleano(SYS_ParametroBO.eChave.PERMITIR_MULTIPLOS_ENDERECOS_PESSOA);
            UCEnderecos1.Inicializar(false, !permitirMultiplosEnderecos, "Pessoa");

            bool valor = SYS_ParametroBO.ParametroValorBooleano(SYS_ParametroBO.eChave.PERMITIR_TIPO_CONTATOS_DUPLICADOS);
            UCGridContato1.InicializarContato(valor);

            if ((PreviousPage != null) && (PreviousPage.IsCrossPagePostBack))
            {
                _VS_pes_id = PreviousPage.EditItem;
                _LoadFromEntity();
            }
            else
            {
                string pais_padrao = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.PAIS_PADRAO_BRASIL);

                if (!string.IsNullOrEmpty(pais_padrao))
                {
                    UCCadastroPessoa1._ComboNacionalidade.SelectedValue = pais_padrao;
                }

                UCGridContato1._CarregarContato();
                UCGridDocumento1._CarregarDocumento(Guid.Empty);
                UCGridCertidaoCivil1._CarregarCertidaoCivil();

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

            Page.Form.DefaultFocus  = UCCadastroPessoa1._txtNome.ClientID;
            Page.Form.DefaultButton = _btnSalvar.UniqueID;
        }

        #region INICIALIZACAO DOS DELEGATES

        UCCadastroPessoa1._Selecionar += UCCadastroPessoa1__Seleciona;

        #endregion INICIALIZACAO DOS DELEGATES
    }
    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;
    }