protected void Page_Load(object sender, EventArgs e) { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao)); } // Page.ClientScript.RegisterStartupScript(GetType(), fdsFormatoAvaliacao.ClientID, String.Format("MsgInformacao('{0}');", String.Concat("#", fdsFormatoAvaliacao.ClientID)), true); UCComboQtdePaginacao1.GridViewRelacionado = _dgvFormatoAvaliacao; if (!IsPostBack) { string message = __SessionWEB.PostMessages; if (!String.IsNullOrEmpty(message)) { _lblMessage.Text = message; } _dgvFormatoAvaliacao.PageSize = ApplicationWEB._Paginacao; try { VerificaBusca(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro); } Page.Form.DefaultButton = _btnPesquisar.UniqueID; Page.Form.DefaultFocus = _txtNome.ClientID; _divPesquisa.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar; _btnPesquisar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar; _btnLimparPesquisa.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar; } }
protected void btnExcluirObjetivo_Click(object sender, EventArgs e) { try { // Pegar os ID's dos itens que serão excluídos. ImageButton btn = (ImageButton)sender; string obj_id = btn.CommandArgument.Split(';')[0]; ORC_Objetivo entity = new ORC_Objetivo { obj_id = Convert.ToInt32(string.IsNullOrEmpty(obj_id) ? "0" : obj_id) }; if (entity.obj_id > 0) { ORC_ObjetivoBO.Delete(entity); ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Delete, "obj_id: " + entity.obj_id); VS_EditItem = -1; // Recarregar repeater. CarregarObjetivosConteudos(); lblMensagem.Text = UtilBO.GetErroMessage("Objetivo da orientação curricular excluído com sucesso.", UtilBO.TipoMensagem.Sucesso); } else { lblMensagem.Text = UtilBO.GetErroMessage("Não foi possível excluir o objetivo da orientação curricular.", UtilBO.TipoMensagem.Alerta); } } catch (ValidationException ex) { lblMensagem.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar excluir o objetivo da orientação curricular.", 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.CamposData)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask)); sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos)); } // Seta delegates UCCCursoCurriculo.IndexChanged += UCCCursoCurriculo_IndexChanged; if (!IsPostBack) { try { // Inicializa componentes UCCCursoCurriculo.CarregarPorSituacaoCurso(1); MostrarTiposDisciplina(ddlTipoLancamento.SelectedValue == ((byte)EnumTipoLancamento.Disciplinas).ToString()); if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { VS_tpr_id = PreviousPage.Edit_tpr_id; Carregar(VS_tpr_id); } btnSalvar.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir || __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_alterar; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o tipo de resultado.", UtilBO.TipoMensagem.Erro); } } Page.Form.DefaultFocus = UCCCursoCurriculo.ClientID_Combo; Page.Form.DefaultButton = btnSalvar.UniqueID; }
protected void Page_Load(object sender, EventArgs e) { try { UCComboUAEscola.IndexChangedUnidadeEscola += UCComboUAEscola_IndexChangedUnidadeEscola; UCComboUAEscola.IndexChangedUA += UCComboUAEscola_IndexChangedUA; UCCCursoCurriculo.IndexChanged += UCCCursoCurriculo_IndexChanged; UCCCalendario.IndexChanged += UCCCalendario_IndexChanged; UCComboTipoCiclo.IndexChanged += UCComboTipoCiclo_IndexChanged; ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.CamposData)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask)); sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos)); } if (!IsPostBack) { InicializarTela(); VerificaBusca(); } } catch (Exception error) { ApplicationWEB._GravaErro(error); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } finally { string message = __SessionWEB.PostMessages; if (!String.IsNullOrEmpty(message)) { lblMessage.Text = message; } // Inserção do título do relatório relTitulo.InnerText = Modulo.mod_nome; } }
/// <summary> /// Mostra botões Subir, Descer, Editar e Excluir /// </summary> private void MostraBotoes() { try { for (int i = 0; i < grvNiveis.Rows.Count; i++) { ImageButton btnAlterar = ((ImageButton)grvNiveis.Rows[i].FindControl("btnAlterar")); if (btnAlterar != null) { ((ImageButton)grvNiveis.Rows[i].FindControl("btnAlterar")).Style.Add("visibility", "visible"); } ((ImageButton)grvNiveis.Rows[i].FindControl("btnSubir")).Style.Add("visibility", "visible"); ((ImageButton)grvNiveis.Rows[i].FindControl("btnDescer")).Style.Add("visibility", "visible"); ((ImageButton)grvNiveis.Rows[i].FindControl("btnExcluir")).Style.Add("visibility", "visible"); } if (grvNiveis.Rows.Count > 0) { // Esconde botão subir na primeira linha da grid, e botão descer da última linha. ((ImageButton)grvNiveis.Rows[0].FindControl("btnSubir")).Visible = false; ((ImageButton)grvNiveis.Rows[grvNiveis.Rows.Count - 1].FindControl("btnDescer")).Visible = false; // Se o último nível for Habilidades, esconde botão subir. string nome_ultimo_nivel = VS_Dt_Niveis.LastOrDefault().nvl_nome; if ((nome_ultimo_nivel.Length >= 10 && nome_ultimo_nivel.ToLower().Substring(0, 10).Equals("habilidade")) || nome_ultimo_nivel.Length >= 11 && nome_ultimo_nivel.ToLower().Substring(0, 11).Equals("habilidades")) { ((ImageButton)grvNiveis.Rows[grvNiveis.Rows.Count - 1].FindControl("btnSubir")).Visible = false; // Esconde botão descer da penúltima linha. ((ImageButton)grvNiveis.Rows[grvNiveis.Rows.Count - 2].FindControl("btnDescer")).Visible = false; } } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os níveis da orientação curricular.", UtilBO.TipoMensagem.Erro); } }
protected void Page_Load(object sender, EventArgs e) { try { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao)); } UCComboQtdePaginacao1.GridViewRelacionado = grvTipoJustificativaExclusaoAulas; if (!IsPostBack) { string message = __SessionWEB.PostMessages; if (!String.IsNullOrEmpty(message)) { lblMessage.Text = message; } // quantidade de itens por página string qtItensPagina = SYS_ParametroBO.ParametroValor(SYS_ParametroBO.eChave.QT_ITENS_PAGINACAO); int itensPagina = string.IsNullOrEmpty(qtItensPagina) ? ApplicationWEB._Paginacao : Convert.ToInt32(qtItensPagina); // mostra essa quantidade no combobox UCComboQtdePaginacao1.Valor = itensPagina; // atribui essa quantidade para o grid grvTipoJustificativaExclusaoAulas.PageSize = itensPagina; Page.Form.DefaultButton = btnNovo.UniqueID; grvTipoJustificativaExclusaoAulas.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_consultar; btnNovo.Visible = __SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir; } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Configuracao", "TipoJustificativaExclusaoAulas.Busca.ErroCarregarDados").ToString(), UtilBO.TipoMensagem.Erro); } }
/// <summary> /// Verifica alteracao do index do combo Escola e trata o combo calendario /// </summary> public void UCComboUAEscola_IndexChangedUnidadeEscola() { try { UCCCalendario.Visible = false; if (_VS_alteraCalendario) { UCCCalendario.Valor = -1; UCCCalendario.PermiteEditar = false; } else { if (!_VS_AnosAnteriores) { UCCCalendario.CarregarCalendarioAnualAnoAtual(); } else { UCCCalendario.CarregarCalendarioAnual(); } } if (_VS_alteraCalendario && UCComboUAEscola.Uad_ID != Guid.Empty) { UCCCalendario.CarregarCalendarioAnualAnoAtual(); UCCCalendario.PermiteEditar = true; } if (UCCCalendario.QuantidadeItensCombo > 2 && UCCCalendario.PermiteEditar) { UCCCalendario.Visible = true; } UCCCalendario_IndexChanged(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } }
private void Salvar() { bool sucessoSalvar = true; bool sucessoAgendar = true; CFG_Alerta alerta = CFG_AlertaBO.GetEntity(new CFG_Alerta { cfa_id = VS_cfa_id }); alerta.cfa_nome = txtNome.Text; alerta.cfa_periodoAnalise = string.IsNullOrEmpty(txtPeriodoAnalise.Text) ? 0 : Convert.ToInt32(txtPeriodoAnalise.Text); alerta.cfa_periodoValidade = string.IsNullOrEmpty(txtPeriodoValidade.Text) ? 0 : Convert.ToInt32(txtPeriodoValidade.Text); alerta.cfa_assunto = txtAssunto.Text; sucessoSalvar = CFG_AlertaBO.Salvar(alerta, CarregaGruposSelecionados()); if (sucessoSalvar) { try { SalvarTriggerQuartz(alerta.cfa_nomeProcedimento, chkDesativar.Checked ? (byte)GestaoEscolarServicosBO.eServicoAtivo.Desabilitado : (byte)GestaoEscolarServicosBO.eServicoAtivo.Ativo); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); sucessoAgendar = false; } } if (sucessoSalvar && sucessoAgendar) { __SessionWEB.PostMessages = UtilBO.GetErroMessage(GetGlobalResourceObject("GestaoEscolar.Configuracao.Alertas.Cadastro", "mensagemSucessoSalvar").ToString(), UtilBO.TipoMensagem.Sucesso); Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "Configuracao/Alertas/Busca.aspx", false); HttpContext.Current.ApplicationInstance.CompleteRequest(); } else { lblMessage.Text = UtilBO.GetErroMessage(sucessoSalvar ? "Erro ao tentar agendar o alerta." : "Erro ao tentar salvar alerta.", UtilBO.TipoMensagem.Erro); } }
private void _LoadSelectedGrupoUsuario(Guid gru_id) { try { _LoadGrupos(true); _LimparDivAddGrupos(); _ddlGrupos.SelectedValue = gru_id.ToString(); _ddlGrupos.Enabled = false; SYS_UsuarioBO.TmpGrupos grupo = _VS_Grupos[gru_id]; _ckbGrupo_Bloqueado.Checked = (grupo.usg_situacao == 2) ? true : false; SYS_Grupo entityGrupo = new SYS_Grupo { gru_id = gru_id }; SYS_GrupoBO.GetEntity(entityGrupo); _VisibleUa(entityGrupo.vis_id); List <SYS_UsuarioBO.TmpEntidadeUA> lt = _VS_EntidadeUA[gru_id]; foreach (SYS_UsuarioBO.TmpEntidadeUA ent in lt) { ListItem li; if (ent.Entidade) { li = new ListItem(ent.EntidadeOrUA, ent.ent_id.ToString()); } else { li = new ListItem(ent.EntidadeOrUA, String.Concat(ent.ent_id, ";", ent.uad_id)); } _lstUAs.Items.Add(li); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o grupo.", UtilBO.TipoMensagem.Erro); } }
protected void Page_Load(object sender, EventArgs e) { try { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference("~/Includes/jsAlunosTurma.js")); sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask)); sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos)); } if (!IsPostBack) { if ((PreviousPage != null) && (PreviousPage.IsCrossPagePostBack)) { _VS_tur_id = PreviousPage.Edit_tur_id; _VS_SituacaoAtiva = (PreviousPage.Edit_tur_situacao == "Ativo"); if (_VS_tur_id > 0) { carregaTela(); } else { VoltarBusca(); } } else { VoltarBusca(); } } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } }
private void ConfiguraUsuarioAD() { switch (integracaoAD) { case SYS_UsuarioBO.eIntegracaoAD.NaoIntegrado: case SYS_UsuarioBO.eIntegracaoAD.IntegradoADReplicacaoSenha: divDominios.Visible = false; divOpcoesSenha.Visible = true; _ddlDominios.SelectedValue = string.Empty; _txtDominio.Text = string.Empty; _rfvConfirmarSenha.Enabled = true; _rfvSenha.Enabled = _VS_usu_id == Guid.Empty; _txtSenha.Text = string.Empty; _txtConfirmacao.Text = string.Empty; _chkSenhaAutomatica.Checked = false; ConfiguraSenhaAutomatica(); _ckbUsuarioLive.Visible = (VS_ExistsIntegracaoExterna ? true : false); break; case SYS_UsuarioBO.eIntegracaoAD.IntegradoAD: divDominios.Visible = true; _TrataOutrosDominios(); divOpcoesSenha.Visible = false; _rfvConfirmarSenha.Enabled = false; _rfvSenha.Enabled = false; _txtSenha.Text = string.Empty; _txtConfirmacao.Text = string.Empty; _chkSenhaAutomatica.Checked = false; ConfiguraSenhaAutomatica(); _ckbUsuarioLive.Visible = false; _ckbUsuarioLive.Checked = false; revSenha.Enabled = false; revSenhaTamanho.Enabled = false; break; default: _lblMessage.Text = UtilBO.GetErroMessage("Tipo de integração com AD inválido.", UtilBO.TipoMensagem.Alerta); break; } ; }
private void _Salvar() { try { GridView grd = _dgvModulo; List <SYS_Modulo> lst = new List <SYS_Modulo>(); foreach (GridViewRow row in grd.Rows) { SYS_Modulo mod = new SYS_Modulo(); mod.sis_id = _VS_sis_id; mod.mod_id = Convert.ToInt32(grd.DataKeys[row.DataItemIndex].Values[0]); CheckBox ckbAuditoria = (CheckBox)row.Cells[2].FindControl("_ckbAuditoria"); if (ckbAuditoria != null) { mod.mod_auditoria = ckbAuditoria.Checked; } else { mod.mod_auditoria = false; } lst.Add(mod); } if (new SYS_ModuloBO().SalvarAuditoria(lst)) { ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "sis_id: " + _VS_sis_id); __SessionWEB.PostMessages = UtilBO.GetErroMessage("Configuração de auditoria salva com sucesso.", UtilBO.TipoMensagem.Sucesso); Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "ConfiguracoesAuditoria/Busca.aspx", false); } else { _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar a configuração de auditoria.", UtilBO.TipoMensagem.Erro); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar salvar a configuração de auditoria.", UtilBO.TipoMensagem.Erro); } }
private void _Pesquisar() { try { Dictionary <string, string> filtros = new Dictionary <string, string>(); _grvUnidadeFederativa.PageIndex = 0; odsUnidadeFederativa.SelectParameters.Clear(); odsUnidadeFederativa.SelectParameters.Add("unf_id", Guid.Empty.ToString()); odsUnidadeFederativa.SelectParameters.Add("pai_id", UCComboPais._Combo.SelectedValue); odsUnidadeFederativa.SelectParameters.Add("unf_nome", txtUnidadeFederativa.Text); odsUnidadeFederativa.SelectParameters.Add("unf_sigla", string.Empty); odsUnidadeFederativa.SelectParameters.Add("unf_situacao", "0"); odsUnidadeFederativa.SelectParameters.Add("paginado", "true"); odsUnidadeFederativa.DataBind(); #region Salvar busca realizada com os parâmetros do ODS. foreach (Parameter param in odsUnidadeFederativa.SelectParameters) { filtros.Add(param.Name, param.DefaultValue); } __SessionWEB.BuscaRealizada = new Busca { PaginaBusca = Pagina.AreaAdm_ManutencaoUnidadeFederativa , Filtros = filtros }; #endregion _grvUnidadeFederativa.DataBind(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar as unidades federativas.", UtilBO.TipoMensagem.Erro); } }
protected void grvUsuarioAPI_RowEditing(object sender, GridViewEditEventArgs e) { try { GridView grv = ((GridView)sender); grv.EditIndex = e.NewEditIndex; grv.DataBind(); byte uap_situacao = Convert.ToByte(grv.DataKeys[e.NewEditIndex]["uap_situacao"]); DropDownList ddlSituacao = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddlSituacao"); if (ddlSituacao != null) { ddlSituacao.SelectedValue = uap_situacao.ToString(); } ImageButton imgSalvar = (ImageButton)grv.Rows[e.NewEditIndex].FindControl("imgSalvar"); if (imgSalvar != null) { imgSalvar.Visible = true; } ImageButton imgEditar = (ImageButton)grv.Rows[e.NewEditIndex].FindControl("imgEditar"); if (imgEditar != null) { imgEditar.Visible = false; ImageButton imgCancelar = (ImageButton)grv.Rows[e.NewEditIndex].FindControl("imgCancelar"); if (imgCancelar != null) { imgCancelar.Visible = true; } } grv.Rows[e.NewEditIndex].Focus(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar editar os dados.", UtilBO.TipoMensagem.Erro); updMessage.Update(); } }
protected void Page_Load(object sender, EventArgs e) { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation)); } if (!IsPostBack) { try { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { VS_tcp_id = PreviousPage.EditItem; //seta true se a página é postBack VS_previous = true; Carregar(VS_tcp_id); } else { Response.Redirect(__SessionWEB._AreaAtual._Diretorio + "Configuracao/TipoPeriodoCurso/Busca.aspx", false); HttpContext.Current.ApplicationInstance.CompleteRequest(); } UCComboTipoNivelEnsino.CarregarTipoNivelEnsino(); Page.Form.DefaultFocus = UCComboTipoNivelEnsino.Combo_ClientID; UCComboTipoModalidadeEnsino.CarregarTipoModalidadeEnsino(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } lblLegendaCadastroPeriodoCurso.Text = "Cadastro de" + " " + "tipo de" + " " + GestaoEscolarUtilBO.nomePadraoPeriodo(__SessionWEB.__UsuarioWEB.Usuario.ent_id).ToLower(); lblDescricao.Text = "Tipo de" + " " + GestaoEscolarUtilBO.nomePadraoPeriodo(__SessionWEB.__UsuarioWEB.Usuario.ent_id).ToLower() + "*"; } }
protected void btnLimparDocumento_Click(object sender, ImageClickEventArgs e) { ImageButton btnLimparDocumento = (ImageButton)sender; RepeaterItem linha = ((RepeaterItem)btnLimparDocumento.NamingContainer); try { // Se não for um registro do banco, limpa o drop tipo de documento. if (!Convert.ToBoolean(((Label)linha.FindControl("lblBanco")).Text)) { ((DropDownList)linha.FindControl("ddlTipoDoc")).SelectedIndex = -1; } ((TextBox)linha.FindControl("tbNumDoc")).Text = ""; ((TextBox)linha.FindControl("tbDtEmissao")).Text = ""; ((TextBox)linha.FindControl("tbOrgEmissor")).Text = ""; ((DropDownList)linha.FindControl("ddlUF")).SelectedIndex = -1; ((TextBox)linha.FindControl("tbInfCompl")).Text = ""; ((TextBox)linha.FindControl("tbCategoria")).Text = ""; ((TextBox)linha.FindControl("tbClassificacao")).Text = ""; ((TextBox)linha.FindControl("tbCsm")).Text = ""; ((TextBox)linha.FindControl("tbDataEntrada")).Text = ""; ((TextBox)linha.FindControl("tbDataValidade")).Text = ""; ((DropDownList)linha.FindControl("ddlPais")).SelectedIndex = -1; ((TextBox)linha.FindControl("tbSerie")).Text = ""; ((TextBox)linha.FindControl("tbTipoGuarda")).Text = ""; ((TextBox)linha.FindControl("tbVia")).Text = ""; ((TextBox)linha.FindControl("tbSecao")).Text = ""; ((TextBox)linha.FindControl("tbZona")).Text = ""; ((TextBox)linha.FindControl("tbRegiaoMilitar")).Text = ""; ((TextBox)linha.FindControl("tbNumeroRA")).Text = ""; ((TextBox)linha.FindControl("tbDataExpedicao")).Text = ""; ((DropDownList)linha.FindControl("ddlTipoDoc")).Focus(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar limpar os campos do documento.", UtilBO.TipoMensagem.Erro); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { string message = __SessionWEB.PostMessages; if (!string.IsNullOrEmpty(message)) { lblMessage.Text = message; } Pesquisar(); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os alertas.", UtilBO.TipoMensagem.Erro); } }
protected void btnEfetivacao_Click(object sender, EventArgs e) { try { SetaPeriodoSelecionado(); Session["tur_idEfetivacao"] = _VS_tur_id; Session["tud_idEfetivacao"] = _VS_tud_id > 0 ? _VS_tud_id : -1; Session["fav_idEfetivacao"] = _VS_fav_id; Session["ava_idEfetivacao"] = -1; Session["URL_Retorno_Efetivacao"] = Convert.ToByte(URL_Retorno_Efetivacao.EfetivacaoBusca); RedirecionaPagina("~/Classe/Efetivacao/Cadastro.aspx"); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); __SessionWEB.PostMessages = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro); Response.Redirect("~/Classe/Efetivacao/Busca.aspx", false); HttpContext.Current.ApplicationInstance.CompleteRequest(); } }
/// <summary> /// Evento change do combo de UA Superior. /// </summary> private void UCFiltroEscolas1__Selecionar() { try { ucComboUAEscola.FiltroEscolasControladas = null; ucComboUAEscola.CarregaEscolaPorUASuperiorSelecionada(); if (ucComboUAEscola.Uad_ID != Guid.Empty) { ucComboUAEscola.FocoEscolas = true; ucComboUAEscola.PermiteAlterarCombos = true; } ucComboUAEscola.SelectedValueEscolas = new[] { -1, -1 }; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro); } }
private void _ChangeComboPais() { try { // Carrega o estado de acodo com o país selecionado if (!string.IsNullOrEmpty(UCComboPais._Combo.SelectedValue) && UCComboPais._Combo.SelectedValue != new Guid().ToString()) { Guid pai_id = new Guid(); if (!string.IsNullOrEmpty(UCComboPais._Combo.SelectedValue)) { pai_id = new Guid(UCComboPais._Combo.SelectedValue); } } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro); } }
/// <summar> /// Carrega na tela períodos de geração. /// </summary> public void CarregaPeriodo() { try { UCCCalendario1.Obrigatorio = true; UCCCalendario1.SelecionarAnoCorrente = true; UCCCalendario1.CarregarPorDocente(VsIdDoc); if (UCCCalendario1.Valor > 0 && UCCCalendario1.QuantidadeItensCombo <= 2) { gdvAulas.Columns[indiceColunaCalendario].Visible = !(divCalendario.Visible = false); } UCCCalendario1_IndexChanged(); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao carregar os períodos de geração.", UtilBO.TipoMensagem.Erro); } }
/// <summary> /// Verifica alteracao do index do combo cursocurriculo e trata o combo curriculoperiodo /// </summary> public void UCCCursoCurriculo_IndexChanged() { try { UCComboCurriculoPeriodo.Valor = new[] { -1, -1, -1 }; UCComboCurriculoPeriodo.PermiteEditar = false; if (UCCCursoCurriculo.Valor[0] > 0 && UCCCursoCurriculo.Valor[1] > 0) { UCComboCurriculoPeriodo._Load(UCCCursoCurriculo.Valor[0], UCCCursoCurriculo.Valor[1]); UCComboCurriculoPeriodo.FocaCombo(); UCComboCurriculoPeriodo.PermiteEditar = true; UCComboCurriculoPeriodo__OnSelectedIndexChange(); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", 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.MsgConfirmExclusao)); } if (!IsPostBack) { lblObsoletoMsg.Text = UtilBO.GetErroMessage("Esta funcionalidade está obsoleta.", UtilBO.TipoMensagem.Alerta); fdsResultados.Visible = false; string postMessage = this.__SessionWEB.PostMessages; if (!String.IsNullOrEmpty(postMessage)) { this._lblMessage.Text = UtilBO.GetMessage(postMessage, UtilBO.TipoMensagem.Sucesso); } this._btnNovo.Visible = this.__SessionWEB.__UsuarioWEB.GrupoPermissao.grp_inserir; this._dgvServidor.Columns[dgvServidorColumnExcluir].Visible = this.__SessionWEB.__UsuarioWEB.GrupoPermissao.grp_excluir; } }
protected void UCComboCalendario1_IndexChanged() { try { if (UCComboCalendario1.Valor > 0) { UCComboCursoCurriculo1.CarregarCursoCurriculoPorEscolaCalendario(-1, -1, 0, UCComboCalendario1.Valor); UCComboCursoCurriculo1.PermiteEditar = true; } else { UCComboCursoCurriculo1.Valor = new int[] { -1, -1 }; UCComboCursoCurriculo1.PermiteEditar = false; } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } }
protected void Page_Load(object sender, EventArgs e) { UCCTipoRelatorioAtendimento.IndexChanged += UCCTipoRelatorioAtendimento_IndexChanged; UCCUAEscola.IndexChangedUA += UCCUAEscola_IndexChangedUA; UCCUAEscola.IndexChangedUnidadeEscola += UCCUAEscola_IndexChangedUnidadeEscola; UCCCursoCurriculo.IndexChanged += UCCCursoCurriculo_IndexChanged; if (!IsPostBack) { try { InicializarTela(); VerificaBusca(); } catch (Exception ex) { lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); ApplicationWEB._GravaErro(ex); } } }
/// <summary> /// Carrega dados do tipo de evento /// </summary> /// <param name="tev_id">ID do tipo de evento</param> private void _LoadFromEntity(int tev_id) { try { ACA_TipoEvento TipoEvento = new ACA_TipoEvento { tev_id = tev_id }; ACA_TipoEventoBO.GetEntity(TipoEvento); _VS_tev_id = TipoEvento.tev_id; _txtTipoEvento.Text = TipoEvento.tev_nome; _ckbPeriodoCalendario.Checked = TipoEvento.tev_periodoCalendario; _rdlLiberacao.SelectedValue = (TipoEvento.tev_liberacao > 0 ? TipoEvento.tev_liberacao : 1).ToString(); _ckbBloqueado.Checked = !TipoEvento.tev_situacao.Equals(1); _ckbBloqueado.Visible = true; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o tipo de evento.", UtilBO.TipoMensagem.Erro); } }
protected void uccFiltroEscola_IndexChangedUA() { try { uccCurriculoPeriodo._Combo.SelectedValue = "-1;-1;-1"; uccCurriculoPeriodo._Combo.Enabled = false; uccDisciplina.Valor = -1; uccDisciplina.PermiteEditar = false; uccCursoCurriculo.CarregarCursoComDisciplinaEletiva(uccFiltroEscola.Esc_ID, uccFiltroEscola.Uni_ID); uccDocente.Doc_id = -1; uccDocente.PermiteEditar = false; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } }
protected void btnExcluir_Click(object sender, EventArgs e) { try { CFG_Arquivo entArquivo = PES_PessoaBO.RetornaFotoPor_Pessoa(_VS_pes_id); if (entArquivo.IsNew && _iptFoto.PostedFile != null) { entArquivo = CFG_ArquivoBO.CriarEntidadeArquivo(_iptFoto.PostedFile); } _VS_excluir_foto = (byte)(ACA_AlunoBO.ExcluirFotoAluno(_VS_pes_id, entArquivo.arq_id) ? 1 : 2); string script = String.Format("RemoveConfirmDialogButton('{0}');", String.Concat("#", btnCapturaFoto.ClientID)); btnCapturaFoto.OnClientClick = script; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar excluir foto.", UtilBO.TipoMensagem.Erro); } }
/// <summary> /// Carrega os dados do Tipo de Entidade nos controles caso seja alteração. /// </summary> /// <param name="ten_id"></param> private void _Carregar(Guid ten_id) { try { SYS_TipoEntidade _TipoEntidade = new SYS_TipoEntidade { ten_id = ten_id }; SYS_TipoEntidadeBO.GetEntity(_TipoEntidade); _VS_ten_id = _TipoEntidade.ten_id; _txtTipoEntidade.Text = _TipoEntidade.ten_nome; if (_TipoEntidade.ten_situacao == 2) { _ckbBloqueado.Checked = true; } } catch (Exception e) { ApplicationWEB._GravaErro(e); _lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o tipo de entidade.", UtilBO.TipoMensagem.Erro); } }
protected void btnPesquisarEscolaOrigemDestino_Click(object sender, EventArgs e) { try { grvEscolaOrigemDestino.PageIndex = 0; odsEscolaOrigemDestino.SelectParameters.Clear(); odsEscolaOrigemDestino.SelectParameters.Add("eco_nome", txtBuscaEscolaOrigemDestino.Text.Trim()); odsEscolaOrigemDestino.SelectParameters.Add("tre_id", VS_tre_id > 0 ? VS_tre_id.ToString() : UCComboTipoRedeEnsinoBusca.Valor.ToString()); odsEscolaOrigemDestino.SelectParameters.Add("paginado", "true"); grvEscolaOrigemDestino.DataBind(); fdsResultadosEscolaOrigemDestino.Visible = true; } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessageBuscaEscolaOrigemDestino.Text = UtilBO.GetErroMessage("Erro ao tentar carregar " + lblNomeEscolaOrigemDestino.Text.Replace("*", "").ToLower() + ".", UtilBO.TipoMensagem.Erro); } }