protected void GridContas_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Editar")) { Nota nota = new Nota(Convert.ToInt32(GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text.Trim())); nota.NumeroDocumento = Convert.ToString(GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text.Trim()); Usuario usuario = (Usuario)Session["UsuarioLogado"]; Session["NotaParaEdicao"] = NotaFacade.VerificaNotaExistente(nota); Response.Redirect(@"~/Estoque/Gerencia/EstoqueNotaEdicao.aspx"); } if (e.CommandName.Equals("Duplicar")) { LblDuplicarTituloCodigoConta.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text.Trim(); LblDuplicarTituloNumero.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text.Trim(); lblDataVencimento.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[3].Text.Trim(); lblDuplicarValorDocumento.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[4].Text.Trim(); MPEDuplicata.Show(); } if (e.CommandName.Equals("Comprovante")) { lblCodigo.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text.Trim(); lblTitulo.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text.Trim(); lblParcela.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[2].Text.Trim(); lblVencimento.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[3].Text.Trim(); lblValor.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[4].Text.Trim(); lblPagoSN.Text = GridContas.Rows[Convert.ToInt32(e.CommandArgument)].Cells[5].Text.Trim(); if (lblPagoSN.Text.Equals("N")) { btnBaixarTitulo.BackColor = System.Drawing.Color.Red; btnBaixarTitulo.Text = "Baixar?"; } else { btnBaixarTitulo.BackColor = System.Drawing.Color.DodgerBlue; btnBaixarTitulo.Text = "Baixado"; } string diretorio = MapPath(@"~\Imagens\Comprovante\"); string strUrl = diretorio + "Comprovante" + lblCodigo.Text + "." + lblEmpresaCodigo.Text + ".jpg"; if (File.Exists(strUrl)) { imgNota.ImageUrl = "~/Imagens/Comprovante/" + "Comprovante" + lblCodigo.Text + "." + lblEmpresaCodigo.Text + ".jpg"; imgNota.Enabled = true; } else { imgNota.ImageUrl = "~/imagens/invoice_icon.jpg"; imgNota.Enabled = false; } ModalPopupExtender1.Show(); } }
protected void GridPesquisa_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { Nota nota = new Nota(Convert.ToInt32(GridPesquisa.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text.Trim())); nota.NumeroDocumento = Convert.ToString(GridPesquisa.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text.Trim()); Usuario usuario = (Usuario)Session["UsuarioLogado"]; if (e.CommandName.Equals("Editar")) { Session["NotaParaEdicao"] = NotaFacade.VerificaNotaExistente(nota); //Response.Redirect(@"~/Estoque/Gerencia/EstoqueNotaEdicao.aspx"); Response.Redirect(@"~/Estoque/Gerencia/EstoqueNota.aspx"); } }