/// <summary> /// Mostra os dados não excluídos logicamente no dropdownlist /// </summary> public void CarregarPorNivelEnsinoModalidade(int tne_id, int tme_id) { ddlCombo.Items.Clear(); ddlCombo.DataSource = ACA_TipoCurriculoPeriodoBO.SelectByPesquisa(tne_id, tme_id); MostrarMessageSelecione = true; ddlCombo.DataBind(); SelecionaPrimeiroItem(); }
/// <summary> /// Abre o pop-up para cadastro de período de agendamento /// </summary> /// <param name="dataInicio">Data de início de agendamento</param> /// <param name="dataFim">Data fim de agendamento</param> private void AbrirPopUp(string dataInicio, string dataFim) { try { txtDataInicio.Text = dataInicio; txtDataFim.Text = dataFim; ckbSelecionarTodosPeriodos.Checked = false; dtDadosRepeater = ACA_TipoCurriculoPeriodoBO.SelectByPesquisa(0, 0).AsEnumerable().Where(p => Convert.ToByte(p["tcp_situacao"]) != 3).CopyToDataTable(); var dtNivelEnsino = dtDadosRepeater.AsEnumerable().GroupBy(t => new { tne_id = Convert.ToInt32(t["tne_id"]), tme_id = Convert.ToInt32(t["tme_id"]), tne_nome = t["tne_nome"].ToString() + " - " + t["tme_nome"].ToString(), tne_nomeSimples = t["tne_nome"].ToString(), tne_ordem = Convert.ToInt32(t["tne_ordem"]) }).Select(t => t.Key).Where(t => dtDadosRepeater.AsEnumerable().Any(p => Convert.ToInt32(p["tne_id"]) == t.tne_id && Convert.ToInt32(p["tme_id"]) == t.tme_id)) .OrderBy(t => t.tne_ordem).ThenBy(t => t.tne_nome); rptNivelEnsino.DataSource = dtNivelEnsino; rptNivelEnsino.DataBind(); //Marca os períodos já selecionados no agendamento if (VS_sda_id > 0) { List <ACA_SondagemAgendamentoPeriodo> lstPeriodos = VS_ListaAgendamentoPeriodo.Where(p => p.sda_id == VS_sda_id).ToList(); foreach (RepeaterItem itemN in rptNivelEnsino.Items) { Repeater rptCampos = (Repeater)itemN.FindControl("rptCampos"); if (rptCampos != null) { foreach (RepeaterItem item in rptCampos.Items) { HiddenField hdnId = (HiddenField)item.FindControl("hdnId"); if (hdnId != null && !string.IsNullOrEmpty(hdnId.Value) && lstPeriodos.Any(p => p.tcp_id == Convert.ToInt32(hdnId.Value))) { CheckBox ckbCampo = (CheckBox)item.FindControl("ckbCampo"); if (ckbCampo != null) { ckbCampo.Checked = true; } } } } } } txtDataInicio.Focus(); updPopUp.Update(); divEscola.Visible = false; lblTituloPopUp.Text = GetGlobalResourceObject("Academico", "Sondagem.Agendamento.lblTituloPopUp.Text").ToString(); btnAdicionar.Text = VS_sda_id > 0 && VS_sda_idRetificar <= 0 ? GetGlobalResourceObject("Academico", "Sondagem.Agendamento.bntAlterar.Text").ToString() : GetGlobalResourceObject("Academico", "Sondagem.Agendamento.bntAdicionar.Text").ToString(); if (VS_sda_idRetificar > 0) { divEscola.Visible = true; VS_sda_idRetificando = VS_sda_id; VS_sda_id = 0; lblTituloPopUp.Text = string.Format(GetGlobalResourceObject("Academico", "Sondagem.Agendamento.lblPeriodoRetificar.Text").ToString(), dataInicio, dataFim); UCComboUAEscola.Inicializar(); if (UCComboUAEscola.VisibleUA) { UCComboUAEscola_IndexChangedUA(); } } else if (VS_sda_idRetificando > 0) { divEscola.Visible = true; string dataInicioR = VS_ListaAgendamento.Where(a => a.sda_id == VS_sda_idRetificando).First().sda_inicio; string dataFimR = VS_ListaAgendamento.Where(a => a.sda_id == VS_sda_idRetificando).First().sda_fim; lblTituloPopUp.Text = string.Format(GetGlobalResourceObject("Academico", "Sondagem.Agendamento.lblPeriodoRetificar.Text").ToString(), dataInicioR, dataFimR); if (UCComboUAEscola.FiltroEscola) { ESC_Escola entEscola = new ESC_Escola { esc_id = VS_esc_id }; ESC_EscolaBO.GetEntity(entEscola); SYS_UnidadeAdministrativa entUA = new SYS_UnidadeAdministrativa { ent_id = entEscola.ent_id, uad_id = entEscola.uad_id }; SYS_UnidadeAdministrativaBO.GetEntity(entUA); Guid uad_idSuperior = entEscola.uad_idSuperiorGestao.Equals(Guid.Empty) ? entUA.uad_idSuperior : entEscola.uad_idSuperiorGestao; UCComboUAEscola.Uad_ID = uad_idSuperior; UCComboUAEscola.EnableEscolas = (UCComboUAEscola.Uad_ID != Guid.Empty); } if (UCComboUAEscola.Uad_ID != Guid.Empty) { UCComboUAEscola.CarregaEscolaPorUASuperiorSelecionada(); UCComboUAEscola.SelectedValueEscolas = new[] { Convert.ToInt32(VS_esc_id), Convert.ToInt32(VS_uni_id) }; } } ScriptManager.RegisterStartupScript(Page, typeof(Page), "EditarAulas", "$('#divInserir').dialog('open');", true); } catch (ValidationException ex) { ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "ScrollToTop", "setTimeout('window.scrollTo(0,0);', 0);", true); lblMessage.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "ScrollToTop", "setTimeout('window.scrollTo(0,0);', 0);", true); lblMessage.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "Sondagem.Agendamento.ErroAbrirPopUp").ToString(), UtilBO.TipoMensagem.Erro); } }