/// <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; UCComboTipoCiclo.Visible = false; UCComboTipoCiclo.Valor = -1; UCComboTipoCiclo.Enabled = false; bool carregarCurriculoPeriodo = false; if (UCCCursoCurriculo.Valor[0] > 0 && UCCCursoCurriculo.Valor[1] > 0) { if (_VS_MostarComboTipoCiclo) { // Carrega o ciclo. UCComboTipoCiclo.CarregarCicloPorCursoCurriculo(UCCCursoCurriculo.Valor[0], UCCCursoCurriculo.Valor[1]); if (UCComboTipoCiclo.ddlCombo.Items.Count > 0) { UCComboTipoCiclo.Visible = true; UCComboTipoCiclo.Enabled = true; UCComboTipoCiclo.ddlCombo.Focus(); UCComboTipoCiclo_IndexChanged(); } else { carregarCurriculoPeriodo = true; } } else { carregarCurriculoPeriodo = true; } if (carregarCurriculoPeriodo) { UCComboCurriculoPeriodo._Load(UCCCursoCurriculo.Valor[0], UCCCursoCurriculo.Valor[1]); UCComboCurriculoPeriodo.FocaCombo(); UCComboCurriculoPeriodo.PermiteEditar = true; UCComboCurriculoPeriodo__OnSelectedIndexChange(); } } else { UCComboCurriculoPeriodo__OnSelectedIndexChange(); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMessage.Text = UtilBO.GetErroMessage("Erro ao tentar carregar os dados.", UtilBO.TipoMensagem.Erro); } }
/// <summary> /// Evento change do combo de curso curriculo /// </summary> private void UCComboCursoCurriculo1_IndexChanged() { try { if (UCComboCursoCurriculo1.Valor[0] > 0) { // carrego o ciclo UCComboTipoCiclo.CarregarCicloPorCursoCurriculo(UCComboCursoCurriculo1.Valor[0], UCComboCursoCurriculo1.Valor[1]); if (UCComboTipoCiclo.ddlCombo.Items.Count > 0) { UCComboTipoCiclo.Visible = true; UCComboTipoCiclo.Enabled = true; UCComboTipoCiclo.ddlCombo.Focus(); UCComboTipoCiclo_IndexChanged(); } else { UCCCurriculoPeriodo1.CarregarPorCursoCurriculo(UCComboCursoCurriculo1.Valor[0], UCComboCursoCurriculo1.Valor[1]); UCCCurriculoPeriodo1.PermiteEditar = true; UCCCurriculoPeriodo1.SetarFoco(); } } else { UCComboTipoCiclo.Visible = false; UCCCurriculoPeriodo1.Valor = new[] { -1, -1, -1 }; UCCCurriculoPeriodo1.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) { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.CamposData)); sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JQueryValidation)); sm.Scripts.Add(new ScriptReference(ArquivoJS.JqueryMask)); sm.Scripts.Add(new ScriptReference(ArquivoJS.MascarasCampos)); } if (!IsPostBack) { try { string message = __SessionWEB.PostMessages; if (!String.IsNullOrEmpty(message)) { lblMensagem.Text = message; } Guid ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id; long doc_id = __SessionWEB.__UsuarioWEB.Docente.doc_id; int visao = __SessionWEB.__UsuarioWEB.Grupo.vis_id; if (VS_visaoDocente) { List <Struct_MinhasTurmas> dados = TUR_TurmaBO.SelecionaPorDocenteControleTurma(ent_id, doc_id, ApplicationWEB.AppMinutosCacheCurto); // Guarda em uma variável as escolas que possuem alguma turma ativa var dadosEscolasAtivas = dados.Where(p => p.Turmas.Any(t => t.tur_situacao == (byte)TUR_TurmaSituacao.Ativo && t.tud_tipo == (byte)TurmaDisciplinaTipo.Regencia)).ToList(); if (dadosEscolasAtivas.Count == 0) { // se o docente não possuir nenhuma turma - exibir a mensagem informativa lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "ControleSemanal.Busca.DocenteSemTurmaRegencia").ToString(), UtilBO.TipoMensagem.Alerta); lblMensagem1.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "ControleSemanal.Busca.DocenteSemTurmaRegencia").ToString(), UtilBO.TipoMensagem.Alerta); } //VS_Dados = dados; rptTurmas.DataSource = dadosEscolasAtivas; rptTurmas.DataBind(); VS_titular = dados.Exists(p => p.Turmas.Any(t => t.tdc_id == (int)EnumTipoDocente.Titular && t.tud_tipo == (byte)TurmaDisciplinaTipo.Regencia)); pnlTurmas.Visible = false; divResultadoDocente.Visible = true; } else { VS_titular = false; divFiltros.Visible = true; grvTurmas.PageSize = ApplicationWEB._Paginacao; #region Inicializar UCComboUAEscola1.FocusUA(); UCComboUAEscola1.Inicializar(); UCComboTipoCiclo.Carregar(); UCComboTipoCiclo.SelectedValue = "-1"; this.VerificarBusca(); #endregion Inicializar Page.Form.DefaultButton = btnPesquisar.UniqueID; Page.Form.DefaultFocus = UCComboUAEscola1.VisibleUA ? UCComboUAEscola1.ComboUA_ClientID : UCComboUAEscola1.ComboEscola_ClientID; } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar carregar o sistema.", UtilBO.TipoMensagem.Erro); } } #region Associando Delegates UCComboUAEscola1.IndexChangedUA += UCComboUAEscola1_IndexChangedUA; UCComboUAEscola1.IndexChangedUnidadeEscola += UCComboUAEscola1_IndexChangedUnidadeEscola; UCCCalendario1.IndexChanged += UCCCalendario1_IndexChanged; UCComboCursoCurriculo1.IndexChanged += UCComboCursoCurriculo1_IndexChanged; UCComboTipoCiclo.IndexChanged += UCComboTipoCiclo_IndexChanged; #endregion Associando Delegates }