protected void grdDados_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { if (e.Row.RowState == DataControlRowState.Alternate) { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid_alternative_row'"); } else { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid'"); } int iIDProspect = Convert.ToInt32(grdDados.DataKeys[e.Row.RowIndex].Values[0].ToString()); string sChave = ConfigurationManager.AppSettings["Chave"].ToString(); string sVetorInicializacao = ConfigurationManager.AppSettings["VetorInicializacao"].ToString(); PontoBr.Seguranca.Criptografia Criptografia = new PontoBr.Seguranca.Criptografia(); string sIDProspect = Criptografia.Criptografar(iIDProspect.ToString(), sChave, sVetorInicializacao); string sLink = "window.location.href='cliente.aspx?idprospect=" + sIDProspect + "';"; e.Row.Attributes.Add("onclick", sLink); } }
protected void dgProspects_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { try { DateTime dDataAgendamento; DateTime dDataAtual = DateTime.Now; dDataAgendamento = PontoBr.Conversoes.Data.ConverterDataDDMMAAAAComBarraeHoraComSegundosParaDateTime(e.Row.Cells[3].Text); if (dDataAgendamento < dDataAtual) { e.Row.Cells[3].ForeColor = System.Drawing.Color.Red; } else { e.Row.Cells[3].ForeColor = System.Drawing.Color.Black; } if (e.Row.RowState == DataControlRowState.Alternate) { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid_alternative_row'"); } else { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid'"); } int iIDProspect = Convert.ToInt32(dgProspects.DataKeys[e.Row.RowIndex].Values[0].ToString()); string sChave = ConfigurationManager.AppSettings["Chave"].ToString(); string sVetorInicializacao = ConfigurationManager.AppSettings["VetorInicializacao"].ToString(); PontoBr.Seguranca.Criptografia Criptografia = new PontoBr.Seguranca.Criptografia(); string sIDProspect = Criptografia.Criptografar(iIDProspect.ToString(), sChave, sVetorInicializacao); e.Row.Attributes.Add("onclick", "parent.AbrirAgendamento('" + sIDProspect + "');"); } catch (Exception ex) { PontoBr.Utilidades.Diversos.ExibirAlertaScriptManager(ex.Message, this.Page); } } }
protected void grdDados_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { if (e.Row.RowState == DataControlRowState.Alternate) { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid_alternative_row'"); } else { e.Row.Attributes.Add("onmouseover", "this.className='grid_row_selecionado'"); e.Row.Attributes.Add("onmouseout", "this.className='grid'"); } int iIDHistorico = Convert.ToInt32(e.Row.Cells[0].Text); string sChave = ConfigurationManager.AppSettings["Chave"].ToString(); string sVetorInicializacao = ConfigurationManager.AppSettings["VetorInicializacao"].ToString(); PontoBr.Seguranca.Criptografia Criptografia = new PontoBr.Seguranca.Criptografia(); string sIDHistorico = Criptografia.Criptografar(iIDHistorico.ToString(), sChave, sVetorInicializacao); string sLink = "window.location.href='venda.aspx?idhistorico=" + sIDHistorico; sLink += "&IDCampanha=" + dropCampanha.SelectedValue; sLink += "&DataInicial=" + txtdatDataInicial.Text; sLink += "&DataFinal=" + txtdatDataFinal.Text; sLink += "&Telefone1=" + txtTelefone1_filtro.Text; sLink += "&Nome=" + txtNome_filtro.Text; sLink += "&CPF_CNPJ=" + txtCPFCNPJ_filtro.Text; sLink += "&IDOperador=" + DropOperador.SelectedValue; sLink += "&IDStatusAuditoria=" + dropStatusAuditoria.SelectedValue; sLink += "&IDDadosVenda=" + dropDadosVenda.SelectedValue; sLink += "&TextoDadosVenda=" + txtTextoDadosVenda.Text; sLink += "';"; e.Row.Attributes.Add("onclick", sLink); } else if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header) { //e.Row.Cells[0].Visible = false; } }