コード例 #1
0
 protected void Grid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "eliminar")
         {
             long archivoAsociadoId  = Convert.ToInt64(this.Grid.DataKeys[Convert.ToInt32(e.CommandArgument)].Value);
             IComprobanteService svc = ServiceFactory.GetComprobanteService();
             svc.CambiarEstado(archivoAsociadoId, CodigosEstadoArchivoAsociado.Eliminado);
             Buscar();
         }
         else if (e.CommandName == "ver")
         {
             long archivoAsociadoId = Convert.ToInt64(this.Grid.DataKeys[Convert.ToInt32(e.CommandArgument)].Value);
             this.Response.Redirect(string.Format("{0}?Id={1}", pagComprobanteAuditoria, archivoAsociadoId), true);
         }
     }
     catch (Exception ex)
     {
         ExceptionManager.Instance.HandleException(ex);
     }
 }