//Inscreve ou remove inscrição de empresa em questionário private void AlteraParticipacao(Int32 IdTurma) { EntTurmaEmpresa objTurmaEmpresa = new EntTurmaEmpresa(); objTurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro = this.EmpresaLogada.IdEmpresaCadastro; objTurmaEmpresa.Turma.IdTurma = IdTurma; objTurmaEmpresa = new BllTurmaEmpresa().ObterPorTurmaEmpresa(objTurmaEmpresa); if (Request["QueroParticipar"] == "1") { //Cria QUESTIONARIO_EMPRESA para o questionario e empresa em questao if (objTurmaEmpresa == null) { objTurmaEmpresa = new BllTurmaEmpresa().InsereInscricaoTurmaEmpresa(this.objPrograma.IdPrograma, this.EmpresaLogada.IdEmpresaCadastro, IdTurma, EmpresaLogada.Estado.IdEstado, IdUsuarioLogado); } else { objTurmaEmpresa.Ativo = true; objTurmaEmpresa.ParticipaPrograma = true; objTurmaEmpresa.UltimaAlteracao = DateTime.Now; if (IdUsuarioLogado > 0) { objTurmaEmpresa.Usuario.IdUsuario = IdUsuarioLogado; } new BllTurmaEmpresa().ParticiparPrograma(objTurmaEmpresa); } } else { //Inativa QUESTIONARIO_EMPRESA atual para o questionario e empresa em questao objTurmaEmpresa.ParticipaPrograma = false; objTurmaEmpresa.UltimaAlteracao = DateTime.Now; new BllTurmaEmpresa().ParticiparPrograma(objTurmaEmpresa); } }
private void DadosDaEmpresa(Int32 IdEmpresaCadastro, Int32 IdPrograma) { EntEmpresaCadastro objEmpresaCadastro = new BllEmpresaCadastro().ObterPorId(IdEmpresaCadastro); EntTurmaEmpresa objTurmaEmpresa = new BllTurmaEmpresa().ObterPorIdEmpresaIdPrograma(objEmpresaCadastro.IdEmpresaCadastro, IdPrograma); this.lblRazaoSocial.Text = objEmpresaCadastro.RazaoSocial; this.lblNomeFantasia.Text = objEmpresaCadastro.NomeFantasia; this.lblCategoria.Text = objTurmaEmpresa.Categoria.Categoria; this.lblCNAE.Text = objTurmaEmpresa.AtividadeEconomica.AtividadeEconomica; this.lblAtividadeEconomicaTxt.Text = objTurmaEmpresa.AtividadeEconomicaComplemento; this.lblCPFCNPJ.Text = objEmpresaCadastro.CPF_CNPJ; this.lblFaturamento.Text = objTurmaEmpresa.Faturamento.Faturamento; this.lblEmpregados.Text = IntUtils.ToString(objTurmaEmpresa.NumeroFuncionario); this.lblDataAbertura.Text = objEmpresaCadastro.AberturaEmpresa.ToShortDateString(); this.lblBairro.Text = objTurmaEmpresa.Bairro.Bairro; this.lblEndereco.Text = objTurmaEmpresa.Endereco; this.lblCEP.Text = objTurmaEmpresa.CEP; this.lblCidade.Text = objTurmaEmpresa.Cidade.Cidade; this.lblEstado.Text = objTurmaEmpresa.Estado.Estado; this.lblContatoNome.Text = objTurmaEmpresa.NomeContato; this.lblContatoCargo.Text = objTurmaEmpresa.Cargo.Cargo; this.lblContatoTelefone.Text = objTurmaEmpresa.TelefoneContato; this.lblContatoCelular.Text = objTurmaEmpresa.CelularContato; this.lblContatoEmail.Text = objTurmaEmpresa.EmailContato; this.lblResposta1.Text = BooleanUtils.ToString(objTurmaEmpresa.Pergunta1); this.lblResposta2.Text = BooleanUtils.ToString(objTurmaEmpresa.Pergunta2); this.lblResposta3.Text = BooleanUtils.ToString(objTurmaEmpresa.Pergunta3); this.lblResposta4.Text = BooleanUtils.ToString(objTurmaEmpresa.Pergunta4); }
private void PopulaGridEmpresa(EntTurmaEmpresa objTurmaEmpresa, EntGrupo objGrupo, String sProtocolo, DateTime dDataInicio, DateTime dDataFim) { ListaGrid = new BllTurmaEmpresa().ObterTodasInscritasPorFiltros(objTurmaEmpresa, objGrupo, sProtocolo, dDataInicio, dDataFim, EntTipoEtapa.TIPO_ETAPA_MPE_INSCRICAO_CANDIDATURA_ADMINISTRATIVO); ListaGridEtiqueta = ListaGrid; ListaGrid = ListaGrid; this.AtualizaGrid(); }
protected void ImgBttnBaixar_Click(object sender, EventArgs e) { //Obtem dados da TurmaEmpresa Anterior Recente e Valido EntTurmaEmpresa objTurmaEmpresa = new BllTurmaEmpresa().ObterTurmaEmpresaAnteriorPorEmpresaCadastro(EmpresaLogada.IdEmpresaCadastro, objPrograma.IdPrograma, objTurma.IdTurma); //Obtem dados para Inscrição EntInscricoesEmpresa objInscricoesEmpresa = new EntInscricoesEmpresa(); objInscricoesEmpresa.TurmaEmpresa = objTurmaEmpresa; objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro = EmpresaLogada; // objInscricoesEmpresa.TurmaEmpresa.Cidade = new EntCidade(); // objInscricoesEmpresa.TurmaEmpresa.Bairro = new EntBairro(); // objInscricoesEmpresa.TurmaEmpresa.CidadeContato = new EntCidade(); // objInscricoesEmpresa.TurmaEmpresa.BairroContato = new EntBairro(); objInscricoesEmpresa.TurmaEmpresa.NumeroFuncionario = 0; // objInscricoesEmpresa.TurmaEmpresa.Faturamento = new EntFaturamento(); this.ObjectToPage(objInscricoesEmpresa); this.ImgBttnBaixar.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["IdTurma"] != null) { int IdTurma = int.Parse(Request["IdTurma"]); AlteraTurma(IdTurma); } String cpfCnpj = ""; if (Request["CpfCnpj"] != null) { this.EmpresaLogada = new BllEmpresaCadastro().ObterPorCpfCnpj(Request["CpfCnpj"]); cpfCnpj = StringUtils.trataCpfCnpj(Request["CpfCnpj"]); //this.OrganizaTabIndex(); this.TxtBxRazaoSocial.Focus(); if (StringUtils.OnlyNumbers(cpfCnpj).Length == 14) { this.TxtBxCNPJCPF.Text = FormatUtils.FormatCNPJ(cpfCnpj); this.LblCPF_CNPJ.Text = "CNPJ:"; } else { this.TxtBxCNPJCPF.Text = FormatUtils.FormatCPF(cpfCnpj); this.LblCPF_CNPJ.Text = "CPF:"; } } this.TxtBxCNPJCPF.Text = cpfCnpj; this.TxtBxCNPJCPF.Enabled = false; String ValorPadrao = "<< Selecione uma Opção >>"; //WebUtils.PopulaDropDownList(DrpDwnLstTipoEmpresa, EnumType.TipoDropDownList.TipoEmpresa, ValorPadrao); //WebUtils.PopulaDropDownList(DrpDwnLstCategoria, EnumType.TipoDropDownList.Categoria, true, ValorPadrao); WebUtils.PopulaDropDownList(CmbBxNivelEscolaridade, EnumType.TipoDropDownList.Escolaridade, ValorPadrao); WebUtils.PopulaDropDownList(CmbBxFaturamento, EnumType.TipoDropDownList.Faturamento, ValorPadrao); WebUtils.PopulaDropDownList(CmbBxCargo, EnumType.TipoDropDownList.Cargo, ValorPadrao); WebUtils.PopulaDropDownList(CmbBxTipoEmpresa, EnumType.TipoDropDownList.TipoEmpresa, ValorPadrao); WebUtils.PopulaDropDownList(CmbBxCategoria, EnumType.TipoDropDownList.Categoria, ValorPadrao); //// teste Combobox //this.CmbBxCategoria.Items.Clear(); //this.CmbBxCategoria.DataSource = new BllCategoria().ObterTodos(true); //this.CmbBxCategoria.DataBind(); //if ((!StringUtils.IsEmpty(ValorPadrao)) || (ValorPadrao != null)) //{ // this.CmbBxCategoria.Items.Insert(0, new ListItem(ValorPadrao, "0")); // this.CmbBxCategoria.SelectedIndex = 0; //} this.PopulaEstado(); this.PopulaEstadoContato(); this.PopulaCidade(0); this.PopulaCidadeContato(0); this.PopulaBairro(0); this.PopulaBairroContato(0); if (this.EmpresaLogada != null && this.EmpresaLogada.IdEmpresaCadastro > 0) { EntInscricoesEmpresa objInscricoesEmpresa = new EntInscricoesEmpresa(); EntTurmaEmpresa objTurmaEmpresa = new EntTurmaEmpresa(); objTurmaEmpresa.EmpresaCadastro = EmpresaLogada; objTurmaEmpresa.Turma = objTurma; objTurmaEmpresa = new BllTurmaEmpresa().ObterPorTurmaEmpresa(objTurmaEmpresa); objInscricoesEmpresa.ProgramaEmpresa = new BllProgramaEmpresa().ObterPorProgramaEmpresa(objPrograma.IdPrograma, EmpresaLogada.IdEmpresaCadastro); if (objInscricoesEmpresa.ProgramaEmpresa != null) { this.HddnFldIdProgramaEmpresa.Value = IntUtils.ToString(objInscricoesEmpresa.ProgramaEmpresa.IdProgramaEmpresa); this.HddnFldSenha.Value = objInscricoesEmpresa.ProgramaEmpresa.Senha; } if (objTurmaEmpresa != null) { this.ObjectToPage(new BllInscricoesEmpresa().ObterPorIdEmpresaTurma(objTurmaEmpresa, objPrograma.IdPrograma)); this.HabilitaCampoSenha(false); } else { // objTurmaEmpresa = new BllTurmaEmpresa().ObterTurmaEmpresaAnteriorPorEmpresaCadastro(EmpresaLogada.IdEmpresaCadastro, objPrograma.IdPrograma, objTurma.IdTurma); // objInscricoesEmpresa.TurmaEmpresa = objTurmaEmpresa; // objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro = EmpresaLogada; // this.ObjectToPageImportacao(objInscricoesEmpresa); this.CmbBxFaturamento.SelectedIndex = 0; this.HabilitaCampoSenha(false); } this.HddnFldIdInscricaoEmpresa.Value = (String)Request.QueryString["IdEmpresaCadastro"]; } //Quando Pessoa Fisica Obrigatóriamente a categoria deve ser AgroNegócio. VerificaCpfCNPJ(); if (Request["CpfCnpj"] != null && (objPrograma.IdPrograma == EntPrograma.PROGRAMA_FGA || objPrograma.IdPrograma == EntPrograma.PROGRAMA_PEG)) { this.TxtBxRazaoSocial.Text = EmpresaLogada.RazaoSocial; this.TxtBxNomeFantasia.Text = EmpresaLogada.NomeFantasia; this.TxtBxDataAbertura.Text = DateUtils.ToString(EmpresaLogada.AberturaEmpresa); this.CmbBxEstado.SelectedValue = EmpresaLogada.Estado.IdEstado.ToString(); this.PopulaCidade(EmpresaLogada.Estado.IdEstado); this.CmbBxCidade.Enabled = true; EntProgramaEmpresa objProgramaEmpresa = new BllProgramaEmpresa().ObterPorProgramaEmpresa(this.objPrograma.IdPrograma, EmpresaLogada.IdEmpresaCadastro); if (objProgramaEmpresa != null) { this.TxtBxNomeCompleto.Text = objProgramaEmpresa.NomeResponsavel; this.TxtBxEmail.Text = objProgramaEmpresa.EmailResponsavel; } } int numeroEmpregados = StringUtils.ToInt(TxtBxNumeroEmpregados.Text); if (numeroEmpregados == -1) { TxtBxNumeroEmpregados.Text = ""; } if (StringUtils.ToDate(TxtBxDtNascimento.Text).Year < 1900) { TxtBxDtNascimento.Text = ""; } } this.UCSelecionaCNAE1.atualizaCampo += this.PopulaAtividadeEconomica; TxtBxCEP.Focus(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (IdTurma == -1) { PnlFundo.Visible = false; } else { if (FlPrivado) { this.LblTipo.Text = "Turma Privada"; } else { this.LblTipo.Text = "Turma Pública"; } this.LblNome.Text = LblTitulo; this.LblDescricao.Text = TxDescricao; this.BtnAcessar.Attributes.Add("IdTurma", IdTurma.ToString()); this.BtnParticipar.Attributes.Add("IdTurma", IdTurma.ToString()); if (FlParticipa) { this.BtnParticipar.ImageUrl = "/Image/queroParticipar_selecionado.png"; this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=0"; this.BtnAcessar.ImageUrl = "/Image/_file_AcessA.png"; if (new BllQuestionarioEmpresa().ObterQuestionarioPorTurmaEmpresa(EmpresaLogada.IdEmpresaCadastro, this.IdTurma) != null) { this.BtnAcessar.PostBackUrl = "~/Paginas/Empresa/SelecionaQuestionario.aspx?IdTurma=" + this.IdTurma; } else { this.BtnAcessar.PostBackUrl = "~/Paginas/CadastroInscricoesEmpresa.aspx?IdTurma=" + this.IdTurma + "&CpfCnpj=" + EmpresaLogada.CPF_CNPJ; } } else { this.BtnParticipar.ImageUrl = "/Image/queroParticipar_nao_selecionado.png"; this.BtnAcessar.ImageUrl = "/Image/_file_AcessI.png"; EntTurmaEmpresa objTurmaEmpresa = new EntTurmaEmpresa(); objTurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro = EmpresaLogada.IdEmpresaCadastro; objTurmaEmpresa.Turma.IdTurma = this.IdTurma; objTurmaEmpresa = new BllTurmaEmpresa().ObterPorTurmaEmpresa(objTurmaEmpresa); if (objTurmaEmpresa != null && objTurmaEmpresa.ParticipaPrograma) { this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=0"; //this.BtnParticipar.PostBackUrl = "~/Paginas/Principal.aspx"; } else { this.EmpresaLogada = new BllEmpresaCadastro().ObterPorId(EmpresaLogada.IdEmpresaCadastro); this.BtnParticipar.PostBackUrl = "~/Paginas/Empresa/SelecionaTurma.aspx?IdTurma=" + this.IdTurma + "&QueroParticipar=1"; } this.BtnAcessar.Enabled = false; } if (!FlInscricaoAberta) { this.BtnAcessar.Enabled = false; this.BtnParticipar.Enabled = false; } } if (NuOrdem == 1) { this.LtrQuebraLinhaInicio.Text = "<tr>"; } else if (NuOrdem == 4) { this.LtrQuebraLinhaFim.Text = "</tr>"; } } }
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"; } } } }
private void PopulaGridEmpresa(EntTurmaEmpresa objTurmaEmpresa, Int32 nIdEscritorioRegional, Int32 nIdGrupo, String sProtocolo, Int32 nIdEstadoRegiao, Boolean?bPergunta1, Boolean?bPergunta2, Boolean?bPergunta3, Boolean?bPergunta4, DateTime dDataInicio, DateTime dDataFim) { ListaGrid = new BllTurmaEmpresa().ObterTodasInscritasPorFiltros(objTurmaEmpresa, nIdEscritorioRegional, nIdGrupo, sProtocolo, nIdEstadoRegiao, bPergunta1, bPergunta2, bPergunta3, bPergunta4, dDataInicio, dDataFim); this.AtualizaGrid(); }