public static String AplicaEstilo(EntPrograma objPrograma) { String retorno = ""; switch (objPrograma.IdPrograma) { case 1: retorno = "/App_Themes/MPE/theme.css"; break; case 2: retorno = "/App_Themes/FGA/theme.css"; break; case 3: retorno = "/App_Themes/PEG/theme.css"; break; default: retorno = "/App_Themes/MPE/theme.css"; break; } return(retorno); }
public static String AplicaFavIcon(EntPrograma objPrograma) { String retorno = ""; switch (objPrograma.IdPrograma) { case 1: retorno = "/favicon.ico"; break; case 2: retorno = "/Image/Fga/favicon.ico"; break; case 3: retorno = "/Image/Peg/favicon.ico"; break; default: retorno = "/favicon.ico"; break; } return(retorno); }
public static String VerificaUrlPorPrograma(EntPrograma objPrograma) { String retorno = ""; switch (objPrograma.IdPrograma) { case 1: retorno = ConfigurationManager.AppSettings["UrlMPE"]; break; case 2: retorno = ConfigurationManager.AppSettings["UrlFGA"]; break; case 3: retorno = ConfigurationManager.AppSettings["UrlPEG"]; break; default: retorno = ConfigurationManager.AppSettings["UrlMPE"];; break; } return(retorno); }
public static EntPrograma VerificaProgramaPorURL(String Url) { EntPrograma objPrograma = new EntPrograma(); String UrlMPE = ConfigurationManager.AppSettings["UrlMPE"]; String UrlFGA = ConfigurationManager.AppSettings["UrlFGA"]; String UrlPEG = ConfigurationManager.AppSettings["UrlPEG"]; if (UrlMPE == Url) { objPrograma.IdPrograma = (int)EnumType.Programa.MPE; } else if (UrlFGA == Url) { objPrograma.IdPrograma = (int)EnumType.Programa.FGA; } else if (UrlPEG == Url) { objPrograma.IdPrograma = (int)EnumType.Programa.PEG; } else { objPrograma.IdPrograma = (int)EnumType.Programa.MPE; } return(objPrograma); }
protected void btnLogin_Click(object sender, EventArgs e) { EntPrograma objPrograma = new EntPrograma(); objPrograma.IdPrograma = StringUtils.ToInt(IdProgramaSessao.Value); String url = WebUtils.VerificaUrlPorPrograma(objPrograma); Response.Redirect(url); }
protected void Page_Load(object sender, EventArgs e) { this.Master.FindControl("UCMenu").Visible = false; EntPrograma objPrograma = new EntPrograma(); objPrograma = WebUtils.VerificaProgramaPorURL(getDominio(this.Page)); Session["objPrograma"] = objPrograma; IdProgramaSessao.Value = ((EntPrograma)Session["objPrograma"]).IdPrograma.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!Request.IsAuthenticated) { Logout(); } if (Session["objPrograma"] == null) { Logout(); } lnkStyleSheet.Href = WebUtils.AplicaEstilo((EntPrograma)Session["objPrograma"]); lnkFavIcon.Href = WebUtils.AplicaFavIcon((EntPrograma)Session["objPrograma"]); Response.CacheControl = "no-cache"; if (!IsPostBack) { EntAdmUsuario objUsuarioLogado = (EntAdmUsuario)Session["objUsuarioLogado"]; if ((objUsuarioLogado != null) && (objUsuarioLogado.IdUsuario > 0)) { this.lblUsuarioLogado.Text = objUsuarioLogado.Usuario; } else { EntEmpresaCadastro objEmpresaLogada = (EntEmpresaCadastro)Session["objEmpresaLogada"]; if ((objEmpresaLogada != null) && (objEmpresaLogada.IdEmpresaCadastro > 0)) { this.lblUsuarioLogado.Text = objEmpresaLogada.RazaoSocial; } else { lblBemVindo.Visible = false; } } } EntPrograma objPrograma = (EntPrograma)Session["objPrograma"]; EntTurma objTurma = (EntTurma)Session["objTurma"]; if (objTurma != null && objPrograma != null && objTurma.IdTurma > 0 && (objPrograma.IdPrograma == EntPrograma.PROGRAMA_FGA || objPrograma.IdPrograma == EntPrograma.PROGRAMA_PEG)) { lblTurma.Visible = true; lblTurma.Text = "Turma " + objTurma.Turma + "\n"; } else { lblTurma.Visible = false; } }
private void HabilitaColunasPorPrograma(EntPrograma objPrograma) { Boolean ExisteEmpreendedorismo = false; switch (objPrograma.IdPrograma) { case (int)EnumType.Programa.MPE: ExisteEmpreendedorismo = true; break; case (int)EnumType.Programa.FGA: ExisteEmpreendedorismo = false; break; default: ExisteEmpreendedorismo = false; break; } // this.grdRelatorioRAA.Columns[14].Visible = ExisteEmpreendedorismo; }