public static string CreateFromAny(dynamic item) { if (item == null) { return("\"null\""); } else if (item is int) { return(item.ToString()); } else if (item is bool) { return(BooleanUtils.ToString(item)); } else if (item is System.Collections.IList) { return(ListUtils.ToString(item)); } else if (item is Card || item is Area || item is User || item is IAttachable) { return(item.ToString()); } else { // is Enum or string return("\"" + item.ToString() + "\""); } }
/// <summary> /// 求和 /// </summary> /// <param name="body1"></param> /// <param name="bodys"></param> public Body CreateUnite(Body body1, List <Body> bodys, out string errs) { errs = ""; string[] err = null; NXOpen.Features.BooleanFeature bf = null; try { bf = BooleanUtils.CreateBooleanFeature(body1, false, false, NXOpen.Features.Feature.BooleanType.Unite, bodys.ToArray()); err = bf.GetFeatureWarningMessages(); } catch (NXException ex) { throw ex; } if (err != null) { foreach (string str in err) { if (str.Equals("One or more tools did not intersect the target.", StringComparison.CurrentCultureIgnoreCase)) { errs = ("一个或多个工具与目标不相交。"); } } } return(bf.GetBodies()[0]); }
private void ExtractFace(Body toolBody, params Face[] face) { List <Body> bodys = new List <Body>(); try { bodys.AddRange(ExtraetUtils.ExtractFaceBuilder(face)); } catch { foreach (Face fe in face) { bodys.Add(ExtraetUtils.ExtraetFace(fe)); } } foreach (Body by in bodys) { try { Body[] bos = BooleanUtils.CreateBooleanFeature(by, false, true, NXOpen.Features.Feature.BooleanType.Intersect, toolBody).GetBodies(); foreach (Body bd in bos) { bd.Color = 6; bd.Layer = 251; } DeleteObject.DeleteParms(bos); } catch { } } }
/// <summary> /// Retorna um Desempenho Global /// </summary> /// <autor>Fernando Carvalho</autor> /// <param name="transaction">Transaction</param> /// <param name="db">DataBase</param> /// <returns><list type="EntCargo">Lista de EntDesempenhoGlobal</list></returns> public List <EntDesempenhoGlobal> GerarDesempenhoGlobal2011(EntDesempenhoGlobal objDesempenhoGlobal, DbTransaction transaction, Database db) { DbCommand dbCommand = db.GetStoredProcCommand("STP_SelecionaDesempenhoGlobal2011"); dbCommand.CommandTimeout = BdConfig.CommmandTimeout; db.AddInParameter(dbCommand, "@NomeFantasia", DbType.String, objDesempenhoGlobal.NomeFantasia); db.AddInParameter(dbCommand, "@CPF_CNPJ", DbType.String, objDesempenhoGlobal.CPF_CNPJ); db.AddInParameter(dbCommand, "@Regiao", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Regiao)); db.AddInParameter(dbCommand, "@Categoria", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Categoria)); db.AddInParameter(dbCommand, "@Grupo", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Grupo)); db.AddInParameter(dbCommand, "@Estado", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Estado)); db.AddInParameter(dbCommand, "@EstadoRegiao", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.EstadoRegiao)); db.AddInParameter(dbCommand, "@Cidade", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Cidade)); db.AddInParameter(dbCommand, "@EscritorioRegional", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.EscritorioRegional)); db.AddInParameter(dbCommand, "@Status", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Status)); db.AddInParameter(dbCommand, "@PremioEspecial", DbType.Int32, BooleanUtils.ToInt(objDesempenhoGlobal.PremioEspecial)); db.AddInParameter(dbCommand, "@Turma", DbType.Int32, IntUtils.ToIntNull(objDesempenhoGlobal.Turma)); dbCommand.CommandTimeout = BdConfig.CommmandTimeout; using (DbDataReader dtrDados = (System.Data.Common.DbDataReader)db.ExecuteReader(dbCommand, transaction)) { if (dtrDados != null && dtrDados.HasRows) { return(this.Popular(dtrDados)); } else { return(new List <EntDesempenhoGlobal>()); } } }
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 ObjectToPage(EntTurma objTurma) { this.HddnFldTurma.Value = objTurma.IdTurma.ToString(); this.ddlEstado.SelectedValue = objTurma.Estado.IdEstado.ToString(); this.TxtNome.Text = objTurma.Turma; this.TxtDescricao.Text = objTurma.Descricao; this.rbTipo.SelectedValue = BooleanUtils.ToInt(objTurma.Privada).ToString(); }
/// <summary> /// 创建布尔减 /// </summary> /// <returns></returns> private NXOpen.Features.BooleanFeature CreateBooleanFeature() { Body toolBody = AskSelectParent(); if (toolBody != null && this.superBox.ToolingBoxFeature != null) { return(BooleanUtils.CreateBooleanFeature(this.superBox.ToolingBoxFeature.GetBodies()[0], false, true, NXOpen.Features.Feature.BooleanType.Subtract, toolBody)); } return(null); }
/// <summary> /// 更新Pitch /// </summary> private bool UpdatePitch() { Part workPart = Session.GetSession().Parts.Work; NXOpen.Features.ExtractFace ext; NXOpen.Features.MoveObject move; NXOpen.Features.PatternGeometry patt; List <Body> bodys = new List <Body>(); Body boolBody; List <NXOpen.Features.BooleanFeature> extBools; GetExtrudeBooleanBody(out boolBody, out extBools); GetFeature(out ext, out move, out patt); if (ext == null || move == null || patt == null || boolBody == null) { return(false); } if (extBools.Count > 0) { DeleteObject.Delete(extBools.ToArray()); } bodys.AddRange(ext.GetBodies()); bodys.AddRange(patt.GetAssociatedBodies()); try { MoveObject.CreateMoveObjToXYZ("moveX", "moveY", "moveZ", move as NXOpen.Features.MoveObject, bodys.ToArray()); } catch (NXException ex) { ClassItem.WriteLogFile("更新移动错误!" + ex.Message); return(false); } List <Body> bys = eleModel.PartTag.Bodies.ToArray().ToList(); bys.Remove(boolBody); SetHeadColour(newAllInfo.Pitch, newAllInfo.GapValue, bys); try { PartUtils.SetPartWork(AssmbliesUtils.GetPartComp(asm, eleModel.PartTag)[0]); Body elebody = BooleanUtils.CreateBooleanFeature(boolBody, false, false, NXOpen.Features.Feature.BooleanType.Unite, bys.ToArray()).GetBodies()[0]; SetEleColor(elebody); PartUtils.SetPartWork(null); } catch (NXException ex) { ClassItem.WriteLogFile("更新求和错误!" + ex.Message); return(false); } return(true); }
public async Task <bool> CancelOrderAsync(IOrder order) { var nonce = GetNonce(); var result = await Rest.PostAsync <string>( $"cancel_order/", new { signature = GetApiSignature(nonce), key = _apiKey, nonce, id = order.OrderId }); ApiRequestCounts++; return(BooleanUtils.GetBooleanValueFromObject(result)); }
public List <Grantee> GranteeSystemPrivileges(string privilege, bool isAdmin) { List <Grantee> result = new List <Grantee>(); DataSet dataSet = this.systemPrivilegeRepository.Grantee(privilege.ToUpper(), BooleanUtils.FromBoolean(isAdmin)); DataTable table = dataSet.Tables[0]; for (int i = 0; i < table.Rows.Count; i++) { Grantee p = new Grantee { Name = table.Rows[i]["GRANTEE"].ToString(), IsAdmin = BooleanUtils.FromString(table.Rows[i]["ADMIN_OPTION"].ToString()) }; result.Add(p); } return(result); }
public List <Privilege> SystemPrivileges(string username, bool isAdmin) { List <Privilege> result = new List <Privilege>(); DataSet dataSet = this.systemPrivilegeRepository.View(username.ToUpper(), BooleanUtils.FromBoolean(isAdmin)); DataTable table = dataSet.Tables[0]; for (int i = 0; i < table.Rows.Count; i++) { Privilege privilege = new Privilege { Name = table.Rows[i]["PRIVILEGE"].ToString(), IsAdmin = BooleanUtils.FromString(table.Rows[i]["ADMIN_OPTION"].ToString()) }; result.Add(privilege); } return(result); }
private bool CreateDatum() { Vector3d dir = new Vector3d(0, 0, -1); try { Body body1 = ExtrudeUtils.CreateExtrude(dir, "0", "DatumHeigth", null, sketch.LeiLine.ToArray()).GetBodies()[0]; CreateChamfer(body1.Tag); SetDatumAttr(body1); Body body2 = ExtrudeUtils.CreateExtrude(dir, "DatumHeigth", "extrudePreparation", null, sketch.WaiLine.ToArray()).GetBodies()[0]; this.DatumBody = BooleanUtils.CreateBooleanFeature(body1, false, false, NXOpen.Features.Feature.BooleanType.Unite, body2).GetBodies()[0]; return(true); } catch (NXException ex) { ClassItem.WriteLogFile("创建基准台错误!" + ex.Message); return(false); } }
/// <summary> /// connectionInfo: /// /// 新建一个账户 /// isnew : true /// id : testmock /// money : 100000 (初始资金) /// datareader : (实时数据读取器,IRealTimeDataReader的实现接口) /// TradeType : 交易方式:0,立即成交;1,市价成交;2、市价延迟时间成交;3、市价延迟tick成交 /// /// isnew = false /// id:testmock /// /// </summary> /// <param name="connectionInfo"></param> public void Connect(ConnectionInfo connectionInfo) { if (this.account != null) { this.account.UnBind(); this.account = null; } Object objIsNew = connectionInfo.GetValue(KEY_ISNEW); bool isNew = BooleanUtils.Parse(objIsNew); if (isNew) { double money = double.Parse(connectionInfo.GetValue(KEY_MONEY).ToString()); this.account = DataCenter.Default.AccountManager.CreateAccount(money); this.account.AccountSetting.AutoFilter = BooleanUtils.Parse(connectionInfo.GetValue(KEY_AUTOFILTER)); this.account.AccountSetting.TradeType = (AccountTradeType)EnumUtils.Parse(typeof(AccountTradeType), connectionInfo.GetValue(KEY_TRADETYPE)); this.account.AccountSetting.DelayTime = NumberUtils.ParseInt(connectionInfo.GetValue(KEY_DELAYTIME)); this.account.AccountSetting.DelayTick = NumberUtils.ParseInt(connectionInfo.GetValue(KEY_DELAYTICK)); this.account.AccountSetting.SlipType = (AccountSlipType)EnumUtils.Parse(typeof(AccountTradeType), connectionInfo.GetValue(KEY_SLIPTYPE)); this.account.AccountSetting.SlipMinPrice = NumberUtils.ParseInt(connectionInfo.GetValue(KEY_SLIPMINPRICE)); this.account.AccountSetting.SlipPerccent = NumberUtils.ParseInt(connectionInfo.GetValue(KEY_SLIPPERCENT)); this.account.AccountSetting.SlipPrice = NumberUtils.ParseInt(connectionInfo.GetValue(KEY_SLIPPRICE)); this.account.BindRealTimeReader((IRealTimeDataReader)connectionInfo.GetValue(KEY_DATAREADER)); string path = connectionInfo.GetValue(KEY_PATH).ToString(); string accountName = connectionInfo.GetValue(KEY_NAME).ToString(); DataCenter.Default.AccountManager.Save(path, accountName, account); } else { string path = connectionInfo.GetValue(KEY_PATH).ToString(); string accountName = connectionInfo.GetValue(KEY_NAME).ToString(); this.account = DataCenter.Default.AccountManager.Load(path, accountName); this.account.BindRealTimeReader((IRealTimeDataReader)connectionInfo.GetValue(KEY_DATAREADER)); } this.account.OnReturnOrder += Account_OnReturnOrder; this.account.OnReturnTrade += Account_OnReturnTrade; }
private void EnviarEmail(String Email) { Int32 RowIndex = ObjectUtils.ToInt(hddRowIndex.Value); String protocolo = ((Label)grdRelatorioRAA.Rows[RowIndex].Cells[15].Controls[1]).Text; Int32 programa = StringUtils.ToInt(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[16].Controls[1]).Text); Boolean avaliador = StringUtils.ToBoolean(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[17].Controls[1]).Text); String caminho = ""; if (protocolo != "") { String estado = null; String categoria = null; List <EntQuestionarioEmpresa> listQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorProtocolo(protocolo); if (listQuestionarioEmpresa != null) { List <EntEmpresaCadastro> listEmpresaCadastro = new BllEmpresaCadastro().ObterPorIdPrograma(listQuestionarioEmpresa[0].EmpresaCadastro.IdEmpresaCadastro, programa); if (listEmpresaCadastro != null) { caminho = gerarRelatorioPDF(listEmpresaCadastro[0].IdEmpresaCadastro.ToString(), listEmpresaCadastro[0].CPF_CNPJ, listQuestionarioEmpresa[0].IdQuestionarioEmpresa.ToString(), protocolo, estado, categoria, false, programa, objTurma.IdTurma, BooleanUtils.ToInt(avaliador), 0, true, this.Page); } } if (caminho != "") { WebUtils.EnviaEmailRaa(Email, "", caminho); } } UCStatus1.UpdateControls(); }
protected void grdRanking_RowCommand(object sender, GridViewCommandEventArgs e) { int index = ObjectUtils.ToInt(e.CommandArgument) - (grdRanking.PageIndex * grdRanking.PageSize); int IdQuestionarioEmpresa = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[0].FindControl("lblIdQuestionarioEmpresa")).Text); int IdEmpresaCadastro = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[1].FindControl("lblIdEmpresaCadastro")).Text); int IdEtapa = StringUtils.ToInt(((Label)this.grdRanking.Rows[index].Cells[2].FindControl("lblIdEtapa")).Text); bool FlPassaProximaEtapa = StringUtils.ToBoolean(((Label)this.grdRanking.Rows[index].Cells[2].FindControl("lblFlPassaProximaEtapa")).Text); if (e.CommandName == "Devolver") { switch (objPrograma.IdPrograma) { 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; } } else if (e.CommandName == "FinalistaGestao") { if (FlPassaProximaEtapa) { new BllRelatorioRanking().EncaminharEtapaAnterior(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false); } else { new BllRelatorioRanking().EncaminharProximaEtapa(IdEmpresaCadastro, (int)EnumType.Questionario.Gestao, IdEtapa, false); } } else if (e.CommandName == "Desclassificar") { Label lblIdQuestionarioEmpresa = ((Label)grdRanking.Rows[index].FindControl("lblIdQuestionarioEmpresa")); Label lblFlDesclassificado = ((Label)grdRanking.Rows[index].FindControl("lblFlDesclassificado")); 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") { this.UCJustificativaRanking1.Show(IdQuestionarioEmpresa, (int)EnumType.TipoEtapaFga.ValidacaoAnaliseRespostas, EnumType.Questionario.Gestao); } CheckBox ChckBxDesclassificar = ((CheckBox)grdRanking.Rows[index].FindControl("ChckBxDesclassificar")); CheckBox ChckBxClassificar = ((CheckBox)grdRanking.Rows[index].FindControl("ChckBxClassificar")); ImageButton imgBttnDesclassificar = ((ImageButton)grdRanking.Rows[index].FindControl("imgBttnDesclassificar")); ImageButton ImgBttnClassificar = ((ImageButton)grdRanking.Rows[index].FindControl("ImgBttnClassificar")); if (ChckBxDesclassificar.Checked) { imgBttnDesclassificar.ImageUrl = "~/Image/unchecked.gif"; ChckBxDesclassificar.Checked = false; ImgBttnClassificar.Enabled = true; } else { imgBttnDesclassificar.ImageUrl = "~/Image/checked.gif"; ChckBxDesclassificar.Checked = true; ImgBttnClassificar.Enabled = false; } } else if (e.CommandName == "Download") { Boolean comentarios = false; Int32 intro = 0; String estado = null; String categoria = null; String protocolo = ((Label)grdRanking.Rows[index].Cells[7].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); } } } } else if (e.CommandName == "DownloadRa") { Boolean comentarios = false; Int32 intro = 0; String estado = null; String categoria = null; String protocolo = ((Label)grdRanking.Rows[index].Cells[7].Controls[1]).Text; Int32 programaId = objPrograma.IdPrograma; 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, 1, intro, false, this.Page); if (caminho != "") { NovaJanela(this.Page, caminho); } } } } PopulaGridEmpresa(); }
protected void grdRelatorioRAA_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Email") { hddRowIndex.Value = ObjectUtils.ToString(e.CommandArgument); this.UCConfirmaEmail1.Show(); } else if (e.CommandName == "Download") { hddRowIndex.Value = ObjectUtils.ToString(e.CommandArgument); Boolean comentarios = false; Int32 intro = 0; Int32 RowIndex = ObjectUtils.ToInt(hddRowIndex.Value); String estado = null; String categoria = null; String protocolo = ((Label)grdRelatorioRAA.Rows[RowIndex].Cells[15].Controls[1]).Text; Int32 programaId = StringUtils.ToInt(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[16].Controls[1]).Text); Boolean avaliador = StringUtils.ToBoolean(((Label)grdRelatorioRAA.Rows[RowIndex].Cells[17].Controls[1]).Text); 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); } } } UCStatus1.UpdateControls(); // Response.Redirect("~/FGA/Paginas/RelatorioRAA.aspx"); } }
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); } } } } }
private void ObjectToPage(EntInscricoesEmpresa objInscricoesEmpresa) { this.HddnFldIdProgramaEmpresa.Value = IntUtils.ToString(objInscricoesEmpresa.ProgramaEmpresa.IdProgramaEmpresa); // Dados da Empresa this.TxtBxRazaoSocial.Text = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.RazaoSocial; this.TxtBxNomeFantasia.Text = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.NomeFantasia; if (objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.PessoaJuridica) { this.TxtBxCNPJCPF.Text = FormatUtils.FormatCNPJ(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.CPF_CNPJ); this.LblCPF_CNPJ.Text = "CNPJ:"; } else { this.TxtBxCNPJCPF.Text = FormatUtils.FormatCPF(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.CPF_CNPJ); this.LblCPF_CNPJ.Text = "CPF:"; } this.TxtBxDataAbertura.Text = DateUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.AberturaEmpresa); this.TxtBxNumeroEmpregados.Text = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.NumeroFuncionario); this.TxtBxEndereco.Text = objInscricoesEmpresa.TurmaEmpresa.Endereco; this.TxtBxComplemento.Text = objInscricoesEmpresa.TurmaEmpresa.Complemento; this.TxtBxNumero.Text = objInscricoesEmpresa.TurmaEmpresa.NumeroEndereco; this.TxtBxCEP.Text = FormatUtils.FormatCEP(objInscricoesEmpresa.TurmaEmpresa.CEP); this.TxtBxPrincipalAtividade.Text = objInscricoesEmpresa.TurmaEmpresa.AtividadeEconomicaComplemento; //this.SelecionaListItem(this.DrpDwnLstTipoEmpresa, objInscricoesEmpresa.TurmaEmpresa.TipoEmpresa.IdTipoEmpresa); this.CmbBxTipoEmpresa.SelectedValue = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.TipoEmpresa.IdTipoEmpresa); this.SelecionaListItem(this.CmbBxFaturamento, objInscricoesEmpresa.TurmaEmpresa.Faturamento.IdFaturamento); //this.SelecionaListItem(this.DrpDwnLstCategoria, objInscricoesEmpresa.TurmaEmpresa.Categoria.IdCategoria); this.CmbBxCategoria.SelectedValue = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Categoria.IdCategoria); this.PopulaAtividadeEconomica(objInscricoesEmpresa.TurmaEmpresa.AtividadeEconomica); if (objInscricoesEmpresa.TurmaEmpresa.Estado.IdEstado == 0) { objInscricoesEmpresa.TurmaEmpresa.Estado = objInscricoesEmpresa.ProgramaEmpresa.EmpresaCadastro.Estado; } this.SelecionaListItem(this.CmbBxEstado, objInscricoesEmpresa.TurmaEmpresa.Estado.IdEstado); if (this.CmbBxEstado.SelectedIndex > 0) { this.CmbBxCidade.Enabled = true; } this.PopulaCidade(objInscricoesEmpresa.TurmaEmpresa.Estado.IdEstado); this.SelecionaListItem(this.CmbBxCidade, objInscricoesEmpresa.TurmaEmpresa.Cidade.IdCidade); if (this.CmbBxCidade.SelectedIndex > 0) { this.CmbBxBairro.Enabled = true; } this.PopulaBairro(objInscricoesEmpresa.TurmaEmpresa.Cidade.IdCidade); this.SelecionaListItem(this.CmbBxBairro, objInscricoesEmpresa.TurmaEmpresa.Bairro.IdBairro); // Dados do Contato this.TxtBxNomeCompleto.Text = objInscricoesEmpresa.TurmaEmpresa.NomeContato; this.TxtBxCPF.Text = FormatUtils.FormatCPF(objInscricoesEmpresa.TurmaEmpresa.CPFContato); this.TxtBxCelular.Text = FormatUtils.FormatTelefone(objInscricoesEmpresa.TurmaEmpresa.CelularContato); this.TxtBxEmail.Text = objInscricoesEmpresa.TurmaEmpresa.EmailContato; this.RdBttnLstSexo.SelectedValue = objInscricoesEmpresa.TurmaEmpresa.SexoContato; this.TxtBxDtNascimento.Text = DateUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.NascimentoContato); this.TxtBxEnderecoCompleto.Text = objInscricoesEmpresa.TurmaEmpresa.EnderecoContato; this.TxtBxComplementoContato.Text = objInscricoesEmpresa.TurmaEmpresa.ComplementoContato; this.TxtBxNumeroContato.Text = objInscricoesEmpresa.TurmaEmpresa.NumeroEnderecoContato; this.TxtBxCEPContato.Text = FormatUtils.FormatCEP(objInscricoesEmpresa.TurmaEmpresa.CEPContato); this.TxtBxTelefoneFixo.Text = FormatUtils.FormatTelefone(objInscricoesEmpresa.TurmaEmpresa.TelefoneContato); this.CmbBxCargo.SelectedValue = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Cargo.IdCargo); this.SelecionaListItem(this.CmbBxEstadoContato, objInscricoesEmpresa.TurmaEmpresa.EstadoContato.IdEstado); if (this.CmbBxEstadoContato.SelectedIndex > 0) { this.CmbBxCidadeContato.Enabled = true; } this.PopulaCidadeContato(objInscricoesEmpresa.TurmaEmpresa.EstadoContato.IdEstado); this.SelecionaListItem(this.CmbBxCidadeContato, objInscricoesEmpresa.TurmaEmpresa.CidadeContato.IdCidade); if (this.CmbBxCidadeContato.SelectedIndex > 0) { this.CmbBxBairroContato.Enabled = true; } this.PopulaBairroContato(objInscricoesEmpresa.TurmaEmpresa.CidadeContato.IdCidade); this.SelecionaListItem(this.CmbBxBairroContato, objInscricoesEmpresa.TurmaEmpresa.BairroContato.IdBairro); this.CmbBxNivelEscolaridade.SelectedValue = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.ContatoNivelEscolaridade.IdContatoNivelEscolaridade); // Teste de AutoAvaliação if (TxtBxEndereco.Text != "") { this.RdBttnLstPergunta1.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta1).ToString(); this.RdBttnLstPergunta2.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta2).ToString(); this.RdBttnLstPergunta3.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta3).ToString(); this.RdBttnLstPergunta4.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta4).ToString(); this.tabelaResposta.Style.Add("display", "block"); } int numSim = 0; if (objInscricoesEmpresa.TurmaEmpresa.Pergunta1) { numSim = numSim + 1; } if (objInscricoesEmpresa.TurmaEmpresa.Pergunta2) { numSim = numSim + 1; } if (objInscricoesEmpresa.TurmaEmpresa.Pergunta3) { numSim = numSim + 1; } if (objInscricoesEmpresa.TurmaEmpresa.Pergunta4 && numSim < 3) { numSim = numSim + 1; } if (numSim == 1) { linha1Coluna1.Style.Add("background", "#58ACFA"); linha1Coluna2.Style.Add("background", "#58ACFA"); } else if (numSim == 2) { linha2Coluna1.Style.Add("background", "#58ACFA"); linha2Coluna2.Style.Add("background", "#58ACFA"); } else if (numSim >= 3) { linha3Coluna1.Style.Add("background", "#58ACFA"); linha3Coluna2.Style.Add("background", "#58ACFA"); } }
protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e) { int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize); if (e.CommandName == "Avaliar") { //Avaliar Label lblIdEmpresaCadastro = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEmpresaCadastro")); int IdEmpresaCadastro = StringUtils.ToInt(lblIdEmpresaCadastro.Text); Label lblIdEtapa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdEtapa")); int IdEtapa = StringUtils.ToInt(lblIdEtapa.Text); int IdTurma = UCFiltroAvaliacao1.IdTurma(); this.UCListaQuestionariosAvaliacao1.Editar(IdEmpresaCadastro, IdEtapa, IdTurma); } else if (e.CommandName == "Formulario") { //Formulario Boolean comentarios = false; Int32 intro = 0; String estado = null; String categoria = null; String protocolo = ((Label)grdSimplificado.Rows[Index].FindControl("lblProtocolo")).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); } } } } else if (e.CommandName == "Devolucao") { //Devolucao Label labelIdQuestionarioEmpresa = ((Label)grdSimplificado.Rows[Index].FindControl("lblIdQuestionarioEmpresa")); String motivoDevolucao = ""; EntQuestionarioEmpresa objQuestionarioEmpresa = new BllQuestionarioEmpresa().ObterPorId(int.Parse(labelIdQuestionarioEmpresa.Text)); if (objQuestionarioEmpresa.MotivoExcluiu != null) { motivoDevolucao = objQuestionarioEmpresa.MotivoExcluiu; } this.TxtDevolucao.Text = motivoDevolucao; this.divDevolucao.Style.Add("display", "block"); } }
protected void grdSimplificado_RowCommand(object sender, GridViewCommandEventArgs e) { int Index = ObjectUtils.ToInt(e.CommandArgument) - (grdSimplificado.PageIndex * grdSimplificado.PageSize); if (e.CommandName == "Download") { Boolean comentarios = false; Int32 intro = 0; String estado = null; String categoria = null; String protocolo = ((Label)grdSimplificado.Rows[Index].Cells[2].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); } } } } }
public override void Set(int v) => a[i] = BooleanUtils.ByteToBool(v);
public override int Get() => BooleanUtils.BoolToByte(a[i]);
public static object ParseAny(string json) { if (json == null || json == "" || json == "\"null\"") { return(null); } int integer; bool boolean; Type enumType; object enumValue; if (int.TryParse(json, out integer)) { // is integer return(integer); } else if (BooleanUtils.TryParse(json, out boolean)) { // is boolean return(boolean); } else if (json.Length > 2 && json.First() == '"' && json.Last() == '"') { if (EnumUtils.TryParse(json, out enumType, out enumValue)) { // is enum return(enumValue); } else { // is string return(json.Substring(1, json.Length - 2)); } } else if (json.Length > 2 && json.First() == '[' && json.Last() == ']') { // is list return(ListUtils.FromString(json)); } else if (json.Length > 2 && json.First() == '{' && json.Last() == '}') { // is object: User, Area, Card, Skill, Buff string[] splited = json.Trim(new char[] { '{', '}' }).Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); string guid = null; foreach (var item in splited) { if (item.Contains("\"guid\": \"")) { guid = item.Replace("\"guid\": \"", "").Trim('\"'); break; } } if (guid == null) { return(null); } object gameObject = Game.GetObject(guid); if (gameObject != null) { return(gameObject); } // is new object (Buff or SubSkill) gameObject = ParseToCreate(json); return(gameObject); } return(null); }
private void ObjectToPage(EntInscricoesEmpresa objInscricoesEmpresa, Boolean ImportacaoOutrosProgramas) { this.HddnFldEmpresaCadastro.Value = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro); this.HddnFldTurma.Value = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Turma.IdTurma); this.PopulaTurma(); SetSelectedItemInDropDownList(CmbBxTurma, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Turma.IdTurma)); this.PopulaEstado(); SetSelectedItemInDropDownList(CmbBxEstado, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Estado.IdEstado)); this.PopulaCidade(objInscricoesEmpresa.TurmaEmpresa.Estado.IdEstado); SetSelectedItemInDropDownList(CmbBxCidade, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Cidade.IdCidade)); this.PopulaBairro(objInscricoesEmpresa.TurmaEmpresa.Cidade.IdCidade); SetSelectedItemInDropDownList(CmbBxBairro, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Bairro.IdBairro)); // Dados da Empresa this.TxtBxRazaoSocial.Text = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.RazaoSocial; this.TxtBxNomeFantasia.Text = objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.NomeFantasia; this.TxtBxCNPJCPF.Text = FormatUtils.FormataCNPJ_CPF(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.CPF_CNPJ); this.TxtBxCNPJCPFValido.Text = this.TxtBxCNPJCPF.Text; this.TxtBxDataAbertura.Text = DateUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.AberturaEmpresa); this.TxtBxEndereco.Text = objInscricoesEmpresa.TurmaEmpresa.Endereco; this.TxtBxNumero.Text = objInscricoesEmpresa.TurmaEmpresa.NumeroEndereco; this.TxtBxComplemento.Text = objInscricoesEmpresa.TurmaEmpresa.Complemento; this.TxtBxCEP.Text = FormatUtils.FormatCEP(objInscricoesEmpresa.TurmaEmpresa.CEP); this.TxtBxPrincipalAtividade.Text = objInscricoesEmpresa.TurmaEmpresa.AtividadeEconomicaComplemento; this.PopulaTipoEmpresa(); SetSelectedItemInDropDownList(CmbBxTipoEmpresa, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.TipoEmpresa.IdTipoEmpresa)); if (!ImportacaoOutrosProgramas) { this.PopulaFaturamento(4); SetSelectedItemInDropDownList(CmbBxFaturamento, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Faturamento.IdFaturamento)); this.TxtBxNumeroEmpregados.Text = IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.NumeroFuncionario); } this.PopulaCategoria(objInscricoesEmpresa.TurmaEmpresa.EmpresaCadastro.PessoaJuridica); SetSelectedItemInDropDownList(CmbBxCategoria, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Categoria.IdCategoria)); this.PopulaAtividadeEconomica(objInscricoesEmpresa.TurmaEmpresa.AtividadeEconomica); // Dados do Contato this.TxtBxNomeCompleto.Text = objInscricoesEmpresa.TurmaEmpresa.NomeContato; this.TxtBxCPF.Text = FormatUtils.FormatCPF(objInscricoesEmpresa.TurmaEmpresa.CPFContato); this.TxtBxCelular.Text = FormatUtils.FormatTelefone(objInscricoesEmpresa.TurmaEmpresa.CelularContato); this.TxtBxEmail.Text = objInscricoesEmpresa.TurmaEmpresa.EmailContato; this.TxtBxDtNascimento.Text = DateUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.NascimentoContato); this.TxtBxEnderecoCompleto.Text = objInscricoesEmpresa.TurmaEmpresa.EnderecoContato; this.TxtBxNumeroContato.Text = objInscricoesEmpresa.TurmaEmpresa.NumeroEnderecoContato; this.TxtBxComplementoContato.Text = objInscricoesEmpresa.TurmaEmpresa.ComplementoContato; this.TxtBxCEPContato.Text = FormatUtils.FormatCEP(objInscricoesEmpresa.TurmaEmpresa.CEPContato); this.TxtBxTelefoneFixo.Text = FormatUtils.FormatTelefone(objInscricoesEmpresa.TurmaEmpresa.TelefoneContato); this.PopulaCargo(); SetSelectedItemInDropDownList(CmbBxCargo, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.Cargo.IdCargo)); this.PopulaEstadoContato(); SetSelectedItemInDropDownList(CmbBxEstadoContato, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.EstadoContato.IdEstado)); this.PopulaCidadeContato(objInscricoesEmpresa.TurmaEmpresa.EstadoContato.IdEstado); SetSelectedItemInDropDownList(CmbBxCidadeContato, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.CidadeContato.IdCidade)); this.PopulaBairroContato(objInscricoesEmpresa.TurmaEmpresa.CidadeContato.IdCidade); SetSelectedItemInDropDownList(CmbBxBairroContato, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.BairroContato.IdBairro)); this.PopulaNivelEscolaridade(); SetSelectedItemInDropDownList(CmbBxNivelEscolaridade, IntUtils.ToString(objInscricoesEmpresa.TurmaEmpresa.ContatoNivelEscolaridade.IdContatoNivelEscolaridade)); SetSelectedItemInDropDownList(RdBttnLstSexo, objInscricoesEmpresa.TurmaEmpresa.SexoContato); List <EntQuestionario> listaQuestionarios = new BllQuestionario().ObterAbertosPorIdTurmaIdEmpresa(this.objTurma.IdTurma, this.EmpresaLogada.IdEmpresaCadastro); foreach (EntQuestionario eq in listaQuestionarios) { if (eq.IdQuestionario == EntQuestionario.QUESTIONARIO_INOVACAO_2011) { if (eq.EmpresaParticipa) { Destaque2.SelectedValue = "1"; } else { Destaque2.SelectedValue = "0"; } } else if (eq.IdQuestionario == EntQuestionario.QUESTIONARIO_RESPONSABILIDADE_2011) { if (eq.EmpresaParticipa) { Destaque1.SelectedValue = "1"; } else { Destaque1.SelectedValue = "0"; } } else if (eq.IdQuestionario == EntQuestionario.QUESTIONARIO_EMPREENDEDORISMO_2011) { if (eq.EmpresaParticipa) { Destaque3.SelectedValue = "1"; } else { Destaque3.SelectedValue = "0"; } } } // Teste de AutoAvaliação this.RdBttnLstPergunta1.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta1).ToString(); this.RdBttnLstPergunta2.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta2).ToString(); this.RdBttnLstPergunta3.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta3).ToString(); this.RdBttnLstPergunta4.SelectedValue = BooleanUtils.ToInt(objInscricoesEmpresa.TurmaEmpresa.Pergunta4).ToString(); }
/// <summary> /// Inclui um registro na tabela TurmaEmpresa /// </summary> /// <autor>Fernando Carvalho</autor> /// <param name="objTurmaEmpresa">Entidade que representa a tabela TurmaEmpresa</param> /// <param name="transaction">Transaction</param> /// <param name="db">DataBase</param> /// <returns>Entidade de TurmaEmpresa</returns> public EntTurmaEmpresa Inserir(EntTurmaEmpresa objTurmaEmpresa, DbTransaction transaction, Database db) { DbCommand dbCommand = db.GetStoredProcCommand("STP_InsereTurmaEmpresa"); dbCommand.CommandTimeout = BdConfig.CommmandTimeout; db.AddInParameter(dbCommand, "@nCEA_EMP_CADASTRO", DbType.Int32, objTurmaEmpresa.EmpresaCadastro.IdEmpresaCadastro); db.AddInParameter(dbCommand, "@nCEA_CATEGORIA", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Categoria.IdCategoria)); db.AddInParameter(dbCommand, "@nCEA_ATIVIDADE_ECONOMICA", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.AtividadeEconomica.IdAtividadeEconomica)); db.AddInParameter(dbCommand, "@nCEA_FATURAMENTO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Faturamento.IdFaturamento)); db.AddInParameter(dbCommand, "@nNU_FUNCIONARIO", DbType.Int32, IntUtils.ToIntNullColaborador(objTurmaEmpresa.NumeroFuncionario)); db.AddInParameter(dbCommand, "@sTX_CEP", DbType.String, StringUtils.ToObject(objTurmaEmpresa.CEP)); db.AddInParameter(dbCommand, "@sTX_ENDERECO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.Endereco)); db.AddInParameter(dbCommand, "@sTX_COMPLEMENTO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.Complemento)); db.AddInParameter(dbCommand, "@sTX_NUMERO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.NumeroEndereco)); db.AddInParameter(dbCommand, "@bFL_ATIVO", DbType.Boolean, true); db.AddInParameter(dbCommand, "@nCEA_USUARIO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Usuario.IdUsuario)); db.AddInParameter(dbCommand, "@nCEA_CIDADE", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Cidade.IdCidade)); db.AddInParameter(dbCommand, "@dDT_ULTIMA_ALTERACAO", DbType.DateTime, System.DateTime.Now); db.AddInParameter(dbCommand, "@nCEA_ESTADO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Estado.IdEstado)); db.AddInParameter(dbCommand, "@nCEA_PAIS", DbType.Int32, 1); db.AddInParameter(dbCommand, "@dDT_CADASTRO", DbType.DateTime, System.DateTime.Now); db.AddInParameter(dbCommand, "@sTX_ATIVIDADE_ECONOMICA", DbType.String, StringUtils.ToObject(objTurmaEmpresa.AtividadeEconomicaComplemento)); db.AddInParameter(dbCommand, "@bFL_PARTICIPA_PROGRAMA", DbType.Boolean, objTurmaEmpresa.ParticipaPrograma); db.AddInParameter(dbCommand, "@sTX_NOME_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.NomeContato)); db.AddInParameter(dbCommand, "@sTX_TELEFONE_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.TelefoneContato)); db.AddInParameter(dbCommand, "@sTX_CELULAR_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.CelularContato)); db.AddInParameter(dbCommand, "@sTX_EMAIL_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.EmailContato)); db.AddInParameter(dbCommand, "@sTX_MENSAGEM_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.MensagemContato)); if (objTurmaEmpresa.CPFContato != null) { db.AddInParameter(dbCommand, "@sTX_CPF_CONTATO", DbType.String, StringUtils.ToObject(StringUtils.removePontuacaoCpfCnpj(objTurmaEmpresa.CPFContato))); } else { db.AddInParameter(dbCommand, "@sTX_CPF_CONTATO", DbType.String, DBNull.Value); } if (objTurmaEmpresa.NascimentoContato.Year > 1900) { db.AddInParameter(dbCommand, "@dDT_DATA_NASCIMENTO_CONTATO", DbType.DateTime, DateUtils.ToObject(objTurmaEmpresa.NascimentoContato)); } else { db.AddInParameter(dbCommand, "@dDT_DATA_NASCIMENTO_CONTATO", DbType.DateTime, DBNull.Value); } db.AddInParameter(dbCommand, "@sTX_ENDERECO_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.EnderecoContato)); db.AddInParameter(dbCommand, "@sTX_COMPLEMENTO_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.ComplementoContato)); db.AddInParameter(dbCommand, "@sTX_NUMERO_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.NumeroEnderecoContato)); db.AddInParameter(dbCommand, "@sTX_SEXO_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.SexoContato)); db.AddInParameter(dbCommand, "@nCEA_NIVEL_ESCOLARIDADE", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.ContatoNivelEscolaridade.IdContatoNivelEscolaridade)); db.AddInParameter(dbCommand, "@nCEA_FAIXA_ETARIA", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.FaixaEtaria.IdContatoFaixaEtaria)); db.AddInParameter(dbCommand, "@nCEA_TURMA", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Turma.IdTurma)); db.AddInParameter(dbCommand, "@nCEA_TIPO_EMPRESA", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.TipoEmpresa.IdTipoEmpresa)); db.AddInParameter(dbCommand, "@nCEA_BAIRRO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Bairro.IdBairro)); db.AddInParameter(dbCommand, "@nCEA_CARGO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.Cargo.IdCargo)); db.AddInParameter(dbCommand, "@sTX_CEP_CONTATO", DbType.String, StringUtils.ToObject(objTurmaEmpresa.CEPContato)); db.AddInParameter(dbCommand, "@bFL_PERGUNTA1", DbType.Boolean, BooleanUtils.ToObject(objTurmaEmpresa.Pergunta1)); db.AddInParameter(dbCommand, "@bFL_PERGUNTA2", DbType.Boolean, BooleanUtils.ToObject(objTurmaEmpresa.Pergunta2)); db.AddInParameter(dbCommand, "@bFL_PERGUNTA3", DbType.Boolean, BooleanUtils.ToObject(objTurmaEmpresa.Pergunta3)); db.AddInParameter(dbCommand, "@bFL_PERGUNTA4", DbType.Boolean, BooleanUtils.ToObject(objTurmaEmpresa.Pergunta4)); db.AddInParameter(dbCommand, "@nCEA_ESTADO_CONTATO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.EstadoContato.IdEstado)); db.AddInParameter(dbCommand, "@nCEA_CIDADE_CONTATO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.CidadeContato.IdCidade)); db.AddInParameter(dbCommand, "@nCEA_BAIRRO_CONTATO", DbType.Int32, IntUtils.ToIntNullProc(objTurmaEmpresa.BairroContato.IdBairro)); db.ExecuteNonQuery(dbCommand, transaction); return(objTurmaEmpresa); }