public void Editar(int IdEstado, int nTipoEtapa) { this.Clear(); ListaGrid = new BllEtapa().ObterPorIdEstado(IdEstado, nTipoEtapa); ObjectToPage(); this.Show(); }
protected void grdEtapaNacional_RowUpdating1(object sender, GridViewUpdateEventArgs e) { ImageButton btnAcao = ((ImageButton)grdEtapaNacional.Rows[e.RowIndex].FindControl("ImagBttnAcao")); Label lblAcaoAux = (Label)grdEtapaNacional.Rows[e.RowIndex].FindControl("LblIdEtapa"); EntEtapa objEtapa = new BllEtapa().ObterPorId(int.Parse(lblAcaoAux.Text)); objEtapa.Ativo = !objEtapa.Ativo; EntEtapaResumo objEtapResumo = new EntEtapaResumo(); this.CriaResumo(objEtapResumo, objEtapa); try { new BllEtapa().AtivaDesativaEtapa(objEtapa, objEtapResumo); MessageBox(this.Page, "Etapa Alterada com sucesso!"); } catch (Exception ex) { MessageBox(this.Page, "Erro ao tentar alterar Etapa!"); //logger.Error("Erro ao inserir o EntUsuario!", ex); } if (StringUtils.ToInt(Request["tipoEtapa"]) == 1) // Nacional { this.PopulaGridEtapasNacionais(); } else { this.PopulaGridEtapasEstaduais(); } }
public void Editar(int IdEtapa) { EntEtapa objEtapa = new BllEtapa().ObterPorId(IdEtapa); ObjectToPage(objEtapa); this.Show(); }
/// <summary> /// Utilizar este metodo para o FGA e o PEG /// </summary> /// <param name="IdTurma"></param> public void Editar(int IdTurma) { this.Clear(); this.HddnFldIdTurma.Value = IdTurma.ToString(); ListaGrid = new BllEtapa().ObterPorTurma(IdTurma); ObjectToPage(); this.Show(); }
protected EntEtapa verificaEtapaInscricaoAberta() { EntEtapa etapaInscricao = null; if (IdUsuarioLogado > 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_MPE_INSCRICAO_CANDIDATURA_ADMINISTRATIVO, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } else { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_MPE_INSCRICAO_CANDIDATURA_EMPRESA, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } return(etapaInscricao); }
protected EntEtapa verificaEtapaInscricaoAberta() { EntEtapa etapaInscricao = null; if (IdUsuarioLogado > 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_PEG_INSCRICAO_AUTODIAGNOSTICO_ADMINISTRATIVO, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } else { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_PEG_INSCRICAO_AUTODIAGNOSTICO_EMPRESA, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); if (etapaInscricao.IdEtapa == 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_PEG_FASE_4, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } } return(etapaInscricao); }
protected void grdEtapaEstadual_RowUpdating(object sender, GridViewUpdateEventArgs e) { this.AlteraStatusItensGrid(); ImageButton btnAcao = ((ImageButton)grdEtapaEstadual.Rows[e.RowIndex].FindControl("ImagBttnAcao")); String imageUrl; Label lblAcaoAux = (Label)grdEtapaEstadual.Rows[e.RowIndex].FindControl("LblAcao"); Label lblIdEtapa = (Label)grdEtapaEstadual.Rows[e.RowIndex].FindControl("LblIdEtapa"); EntEtapa Etapa = new BllEtapa().ObterPorId(int.Parse(lblIdEtapa.Text)); Etapa.Ativo = !Etapa.Ativo; EntEtapaResumo objEtapResumo = new EntEtapaResumo(); this.CriaResumo(objEtapResumo, Etapa); try { new BllEtapa().AtivaDesativaEtapa(Etapa, objEtapResumo); } catch (Exception ex) { MessageBox(this.Page, "Erro ao tentar alterar Etapa!"); } if (Etapa.Ativo) { imageUrl = "~/Image/_file_Ok2.png"; lblAcaoAux.Text = "True"; } else { imageUrl = "~/Image/file_delete2.png"; lblAcaoAux.Text = "False"; } btnAcao.ImageUrl = imageUrl; ListaGrid = new BllEtapa().ObterPorTurma(Etapa.Turma.IdTurma); ObjectToPage(); }
private EntEtapa verificaEtapaAberta() { EntEtapa etapaInscricao = null; if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_MPE) { if (IdUsuarioLogado > 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_MPE_INSCRICAO_CANDIDATURA_ADMINISTRATIVO, objTurma.IdTurma, this.EmpresaLogada.Estado.IdEstado); } else { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_MPE_INSCRICAO_CANDIDATURA_EMPRESA, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } } else if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_FGA) { if (IdUsuarioLogado > 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_FGA_INSCRICAO_AUTODIAGNOSTICO_ADMINISTRATIVO, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } else { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_FGA_INSCRICAO_AUTODIAGNOSTICO_EMPRESA, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } } else if (objPrograma.IdPrograma == EntPrograma.PROGRAMA_PEG) { if (IdUsuarioLogado > 0) { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_PEG_INSCRICAO_AUTODIAGNOSTICO_ADMINISTRATIVO, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } else { etapaInscricao = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_PEG_INSCRICAO_AUTODIAGNOSTICO_EMPRESA, objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); } } return(etapaInscricao); }
private void PopulaGridEtapasNacionais() { ListaGrid = new BllEtapa().ObterEtapasNacionais(StringUtils.ToInt(this.DrpDwnLstTurma.SelectedItem.Value)); this.AtualizaGridNacional(); }
private void PopulaGridEtapasEstaduais() { ListaGrid = new BllEtapa().ObterEtapasEstaduais(StringUtils.ToInt(this.DrpDwnLstTurma.SelectedItem.Value), StringUtils.ToInt(this.DrpDwnLstEstado.SelectedItem.Value), UsuarioLogado.IdUsuario); this.AtualizaGridNacional(); }
private void PopulaGridEtapas(Int32 nIdEstado) { ListaGrid = new BllEtapa().ObterEtapasEstaduais(this.objTurma.IdTurma, nIdEstado, UsuarioLogado.IdUsuario); this.AtualizaGrid(); }
public void UpdateControls() { this.ImgBttnVerificarRelatorios.Enabled = false; this.ImgBttnVerificarRelatorios.Style.Add("cursor", "default"); // Preencher Cadastro EntTurmaEmpresa objTurmaEmpresa = new EntTurmaEmpresa(); objTurmaEmpresa.Turma.IdTurma = objTurma.IdTurma; objTurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro = EmpresaLogada.IdEmpresaCadastro; objTurmaEmpresa = new BllTurmaEmpresa().ObterPorTurmaEmpresa(objTurmaEmpresa); this.ImgBttnPreencherCadastro.Enabled = true; if (this.Page.Title == "Cadastro Inscrição Empresa") { this.ImgBttnPreencherCadastro.ImageUrl = "~/Image/PreencheCadastro-Az.png"; } else if ((EmpresaLogada.IdEmpresaCadastro == 0 || objTurmaEmpresa.CPFContato == "") && this.Page.Title != "Cadastro Inscrição Empresa") { this.ImgBttnPreencherCadastro.ImageUrl = "~/Image/PreencheCadastro.png"; } else { this.ImgBttnPreencherCadastro.ImageUrl = "~/Image/PreencheCadastro-Vd.png"; } // Responder Questionário List <EntQuestionarioEmpresa> lstQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterQuestionarioPorTurmaEmpresa(this.EmpresaLogada.IdEmpresaCadastro, this.objTurma.IdTurma); if (lstQuestionarioEmpresa == null) { this.ImgBttnResponderQuestionario.Enabled = false; this.ImgBttnResponderQuestionario.Style.Add("cursor", "default"); this.ImgBttnResponderQuestionario.ImageUrl = "~/Image/ResponderQuest-C.png"; // Enviar Questionário this.ImgBttnEnviarQuestionario.Enabled = false; this.ImgBttnEnviarQuestionario.Style.Add("cursor", "default"); this.ImgBttnEnviarQuestionario.ImageUrl = "~/Image/EnviaQuestionario-C.png"; } else { List <EntQuestionario> listaQuestionarios = new BllQuestionario().ObterAbertosPorIdTurmaIdEmpresa(this.objTurma.IdTurma, this.EmpresaLogada.IdEmpresaCadastro); Boolean bHistorico = false; Boolean bParticipa = false; foreach (EntQuestionario eq in listaQuestionarios) { if (eq.EmpresaParticipa) { bParticipa = true; if (eq.Obrigatorio) { if (eq.PorcentagemPreenchida > 0 && eq.PorcentagemPreenchida < 100) { bHistorico = true; break; } } else { if (eq.PorcentagemPreenchida >= 0 && eq.PorcentagemPreenchida < 100) { bHistorico = true; break; } } } } if (bHistorico && bParticipa) { this.ImgBttnResponderQuestionario.Enabled = true; this.ImgBttnResponderQuestionario.Style.Add("cursor", "pointer"); this.ImgBttnResponderQuestionario.ImageUrl = "~/Image/ResponderQuest-A.png"; // Enviar Questionário this.ImgBttnEnviarQuestionario.Enabled = false; this.ImgBttnEnviarQuestionario.Style.Add("cursor", "default"); this.ImgBttnEnviarQuestionario.ImageUrl = "~/Image/EnviaQuestionario-C.png"; } else { bHistorico = listaQuestionarios.Count > 0; bParticipa = false; foreach (EntQuestionario eq in listaQuestionarios) { if (eq.EmpresaParticipa) { bParticipa = true; if (eq.PorcentagemPreenchida < 100) { bHistorico = false; break; } } } if (bHistorico && bParticipa) { this.ImgBttnResponderQuestionario.Enabled = true; this.ImgBttnResponderQuestionario.Style.Add("cursor", "pointer"); this.ImgBttnResponderQuestionario.ImageUrl = "~/Image/ResponderQuest-Vd.png"; // Enviar Questionário this.ImgBttnEnviarQuestionario.Enabled = true; this.ImgBttnEnviarQuestionario.Style.Add("cursor", "pointer"); this.ImgBttnEnviarQuestionario.ImageUrl = "~/Image/EnviaQuestionario-Vm.png"; // Gerar Relatório EntEtapa objEtapa = new BllEtapa().ObterPorTipoEtapaTurmaEstado(EntTipoEtapa.TIPO_ETAPA_FGA_INSCRICAO_AUTODIAGNOSTICO_EMPRESA, this.objTurma.IdTurma, EmpresaLogada.Estado.IdEstado); lstQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterQuestionarioEmpresaAtivoPorEmpresaEtapa(this.EmpresaLogada.IdEmpresaCadastro, objEtapa.IdEtapa); // Int32 nEmpresaParticipa = 0; foreach (EntQuestionario eq in listaQuestionarios) { if (eq.EmpresaParticipa) { nEmpresaParticipa++; } } Boolean bRelatorioGerado = false; Int32 nEnviaQuestionario = 0; foreach (EntQuestionarioEmpresa eq in lstQuestionarioEmpresa) { if (eq.EnviaQuestionario) { nEnviaQuestionario++; } bRelatorioGerado = eq.RelatorioGerado; } if (nEmpresaParticipa != nEnviaQuestionario) { this.ImgBttnVerificarRelatorios.Enabled = false; this.ImgBttnVerificarRelatorios.Style.Add("cursor", "default"); this.ImgBttnVerificarRelatorios.ImageUrl = "~/Image/GerarRelatorio-C.png"; } else { this.ImgBttnVerificarRelatorios.Enabled = true; this.ImgBttnVerificarRelatorios.Style.Add("cursor", "pointer"); this.ImgBttnVerificarRelatorios.ImageUrl = "~/Image/GerarRelatorio-Vm.png"; // Enviar Questionário this.ImgBttnEnviarQuestionario.Enabled = true; this.ImgBttnEnviarQuestionario.Style.Add("cursor", "pointer"); this.ImgBttnEnviarQuestionario.ImageUrl = "~/Image/EnviaQuestionario-Vd.png"; } if (bRelatorioGerado) { this.ImgBttnVerificarRelatorios.Enabled = true; this.ImgBttnVerificarRelatorios.Style.Add("cursor", "pointer"); this.ImgBttnVerificarRelatorios.ImageUrl = "~/Image/GerarRelatorio-Vd.png"; } } else { this.ImgBttnResponderQuestionario.Enabled = true; this.ImgBttnResponderQuestionario.Style.Add("cursor", "pointer"); this.ImgBttnResponderQuestionario.ImageUrl = "~/Image/ResponderQuest-Vm.png"; // Enviar Questionário this.ImgBttnEnviarQuestionario.Enabled = false; this.ImgBttnEnviarQuestionario.Style.Add("cursor", "default"); this.ImgBttnEnviarQuestionario.ImageUrl = "~/Image/EnviaQuestionario-C.png"; } } } }
protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e) { int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize); if (e.CommandName == "Gravar") { //Gravar DropDownList DrpDwnLstSenior = ((DropDownList)grdSimplificado.Rows[Index].FindControl("DrpDwnLstSenior")); if (DrpDwnLstSenior.SelectedIndex == 0) { MessageBox(this, "Selecione o Consultor!"); } else { Label lblIdEmpresaCadastro = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro")); Label lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")); ImageButton imgBtnSalvar = ((ImageButton)grdSimplificado.Rows[Index].FindControl("ImgBttnGravar")); int IdEmpresaCadastro = StringUtils.ToInt(((Label)this.grdSimplificado.Rows[Index].Cells[1].FindControl("lblIdEmpresaCadastro")).Text); int IdEtapa = StringUtils.ToInt(((Label)this.grdSimplificado.Rows[Index].Cells[1].FindControl("lblIdEtapa")).Text); RelFiltroRanking objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"])); foreach (EntQuestionarioEmpresa qe in new BllQuestionarioEmpresa().ObterQuestionarioEmpresaAtivoPorTurmaEmpresa(int.Parse(lblIdEmpresaCadastro.Text), objRelFiltroRanking.Turma)) { EntQuestionarioEmpresaAvaliador objQuestionarioEmpresaAvaliador = new EntQuestionarioEmpresaAvaliador(); objQuestionarioEmpresaAvaliador.QuestionarioEmpresa.IdQuestionarioEmpresa = qe.IdQuestionarioEmpresa; objQuestionarioEmpresaAvaliador.Usuario.IdUsuario = StringUtils.ToInt(DrpDwnLstSenior.SelectedValue); objQuestionarioEmpresaAvaliador.Avaliado = false; objQuestionarioEmpresaAvaliador.Primario = true; new BllQuestionarioEmpresaAvaliador().Inserir(objQuestionarioEmpresaAvaliador); } new BllRelatorioRanking().EncaminharProximaEtapa(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false); DrpDwnLstSenior.Enabled = false; imgBtnSalvar.Visible = false; } } else if (e.CommandName == "Desclassificar") { Label lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")); Label lblFlDesclassificado = ((Label)grdSimplificado.Rows[Index].FindControl("lblFlDesclassificado")); int IdQuestionarioEmpresa = StringUtils.ToInt(lblIdQuestionarioEmpresa.Text); if (lblFlDesclassificado.Text == "True") { EntQuestionarioEmpresa objQuestionarioEmpresa = new EntQuestionarioEmpresa(); objQuestionarioEmpresa.IdQuestionarioEmpresa = int.Parse(lblIdQuestionarioEmpresa.Text); objQuestionarioEmpresa.Excluido = false; new BllQuestionarioEmpresa().AlterarSomenteDesclassificar(objQuestionarioEmpresa); } else if (lblFlDesclassificado.Text == "False") { switch (objPrograma.IdPrograma) { case (int)EnumType.Programa.MPE: this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaMpe.ClassificaçãoEstadual, EnumType.Questionario.Gestao); break; case (int)EnumType.Programa.FGA: this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaFga.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao); break; case (int)EnumType.Programa.PEG: this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaPeg.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao); break; default: this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaMpe.ClassificaçãoEstadual, EnumType.Questionario.Gestao); break; } } CheckBox ChckBxDesclassificar = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxDesclassificar")); CheckBox ChckBxClassificar = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxClassificar")); ImageButton imgBttnDesclassificar = ((ImageButton)grdSimplificado.Rows[Index].FindControl("imgBttnDesclassificar")); ImageButton ImgBttnClassificar = ((ImageButton)grdSimplificado.Rows[Index].FindControl("ImgBttnClassificar")); if (ChckBxDesclassificar.Checked) { imgBttnDesclassificar.ImageUrl = "~/Image/unchecked.gif"; ChckBxDesclassificar.Checked = false; HabilitaDesabilitaBotao(ImgBttnClassificar, true); } else { imgBttnDesclassificar.ImageUrl = "~/Image/checked.gif"; ChckBxDesclassificar.Checked = true; HabilitaDesabilitaBotao(ImgBttnClassificar, false); } } else if (e.CommandName == "Visualizar") { RelFiltroRanking objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"])); int IdTurma = objRelFiltroRanking.Turma; int IdEmpresaCadastro = StringUtils.ToInt(((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")).Text); this.UCVisualizarAutodiagnosticoInicial1.Visualiar(IdEmpresaCadastro, IdTurma); } else if (e.CommandName == "Update") { CheckBox ChckBxClassificar = ((CheckBox)grdSimplificado.Rows[Index].FindControl("ChckBxClassificar")); Label lblIdEmpresaCadastro = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro")); Label lblIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")); Label lblIdEstado = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEstado")); Label lblIdEtapa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEtapa")); RelFiltroRanking objRelFiltroRanking = this.UCFiltroRanking1.GetFiltro(int.Parse(Request["TipoEtapaId"])); DropDownList DrpDwnLstSenior = ((DropDownList)grdSimplificado.Rows[Index].FindControl("DrpDwnLstSenior")); EntEmpresaCadastro objEmpresaCadastro = new BllEmpresaCadastro().ObterPorId(int.Parse(lblIdEmpresaCadastro.Text)); if (!ChckBxClassificar.Checked) { List <EntAdmUsuario> ListaUser = new BllAdmUsuario().ObterPorFuncionalidade("Avaliações", objEmpresaCadastro.Estado.IdEstado, objPrograma.IdPrograma, objRelFiltroRanking.Turma); DrpDwnLstSenior.Items.Clear(); DrpDwnLstSenior.DataSource = ListaUser; DrpDwnLstSenior.DataBind(); DrpDwnLstSenior.Items.Insert(0, new ListItem("<< Selecionar >>", "0")); DrpDwnLstSenior.SelectedValue = "0"; } else { EntEtapa objEtapa = new BllEtapa().ObterProximaEtapaPorEtapaEstadoOrdem(int.Parse(lblIdEtapa.Text)); new BllQuestionarioEmpresaAvaliador().RemoverPorQuestionarioEmpresa(int.Parse(lblIdQuestionarioEmpresa.Text)); new BllQuestionarioEmpresa().AlterarSomentePassaProximaEtapa(int.Parse(lblIdQuestionarioEmpresa.Text)); new BllQuestionarioEmpresa().DesabilitaAnteriores(int.Parse(lblIdEmpresaCadastro.Text), objEtapa.IdEtapa, EntQuestionario.QUESTIONARIO_GESTAO_2011); } } else if (e.CommandName == "Download") { Boolean comentarios = false; Int32 intro = 0; String estado = null; String categoria = null; String protocolo = ((Label)grdSimplificado.Rows[Index].Cells[8].Controls[1]).Text; Int32 programaId = objPrograma.IdPrograma; Boolean avaliador = false; String caminho = ""; List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo); if (listQuestionarioEmpresa != null) { List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programaId); if (listEmpresaCadastro != null) { caminho = new PaginaBase().gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, comentarios, programaId, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), intro, false, this.Page); if (caminho != "") { NovaJanela(this.Page, caminho); } } } } }