protected void lnkAnularSeguimiento_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton lnkAnularSeguimiento = (LinkButton)sender;
            char[] delimitador = { '|' };
            string[] args = lnkAnularSeguimiento.CommandArgument.Split(delimitador);

            string numeroPedido = args[0];
            string area = args[1];
            string flujo = args[2];     // El flujo del pedido
            string nrointento = args[3]; // Nro de intento

            In60detalleSeg oIn60detalleSeg = new In60detalleSeg();
            oIn60detalleSeg.In60codemp = _auditoria.CodigoEmpresa;
            oIn60detalleSeg.In60aa = _auditoria.Periodo;
            oIn60detalleSeg.In60Area = area;
            oIn60detalleSeg.In60numped = numeroPedido;
            oIn60detalleSeg.In60NroIntento = int.Parse(nrointento);
            oIn60detalleSeg.in60FlujoProceso = int.Parse(flujo);

            new PedidoBLL().DeshacerAprobacion(oIn60detalleSeg);
            oIn60detalleSeg = null;
            GC.Collect();

            ListarPedido();
        }
        catch (Exception ex)
        {

            throw;
        }
    }
    /// <summary>
    /// Lista pedidos
    /// </summary>
    private void ListarPedido()
    {
        try
        {
            In60pedido oIn60pedido = new In60pedido();
            In60detalleSeg oIn60DetalleSeg = new In60detalleSeg();

            oIn60DetalleSeg.In60codemp=_auditoria.CodigoEmpresa;
            oIn60DetalleSeg.in60FlujoProceso = int.Parse(this.hidFlujoProceso.Value);
            oIn60DetalleSeg.In60Area = this.ddlArea.SelectedValue;
            oIn60DetalleSeg.In60numped = this.txtNroPedido.Text;
            oIn60pedido.In60TipoPedido = this.ddlTipoPedido.SelectedValue;

            DataTable dtData;
            dtData = new PedidoBLL().ListarPedidoSeguimientoxarea(oIn60DetalleSeg, oIn60pedido);

            this.gvBandeja.DataSource = dtData;
            this.gvBandeja.DataBind();

            //Invoca al metodo para paginar la grilla
            Paginar(dtData, this.gvBandeja, this.litNumeroRegistros, this.litPagina);
        }
        catch (Exception)
        {

            throw;
        }
    }
        public void RegistrarDetallePedidoSeguimiento(DbTransaction oDbTransaction, In60detalleSeg oIn60detalleSeg)
        {
            _command = _database.GetStoredProcCommand("Usp_ControlPedido_Ins_In60detalleSeg");
            try
            {

                _database.AddInParameter(_command, "@In60codemp", System.Data.DbType.String, oIn60detalleSeg.In60codemp);
                _database.AddInParameter(_command, "@In60aa", System.Data.DbType.String, oIn60detalleSeg.In60aa);
                _database.AddInParameter(_command, "@In60numped", System.Data.DbType.String, oIn60detalleSeg.In60numped);
                _database.AddInParameter(_command, "@In60Area", System.Data.DbType.String, oIn60detalleSeg.In60Area);
                _database.AddInParameter(_command, "@In60Item", System.Data.DbType.Int16, oIn60detalleSeg.In60Item);

                _database.AddInParameter(_command, "@in60FlujoProceso", System.Data.DbType.Int16, oIn60detalleSeg.in60FlujoProceso);
                _database.AddInParameter(_command, "@In60EstadoAprob", System.Data.DbType.String, oIn60detalleSeg.In60EstadoAprob);
                _database.AddInParameter(_command, "@In60CantidadNueva", System.Data.DbType.Decimal, oIn60detalleSeg.In60CantidadNueva);
                _database.AddInParameter(_command, "@In60Observacion", System.Data.DbType.String, oIn60detalleSeg.In60Observacion);
                _database.AddInParameter(_command, "@in60flagultimoestado", System.Data.DbType.Int16, oIn60detalleSeg.in60flagultimoestado);
                _database.AddInParameter(_command, "@in60Cerrado", System.Data.DbType.Int16, oIn60detalleSeg.in60Cerrado);
                _database.AddInParameter(_command, "@in60UsuarioMod", System.Data.DbType.String, oIn60detalleSeg.@in60UsuarioMod);
                _database.AddInParameter(_command, "@in60FechaMod", System.Data.DbType.String, oIn60detalleSeg.in60FechaMod);
                _database.ExecuteNonQuery(_command, oDbTransaction);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void DeshacerAprobacion(DbTransaction oDbTransaction, In60detalleSeg oIn60detalleSeg)
        {
            _command = _database.GetStoredProcCommand("usp_ControlPedido_DeshacerAprobacion");
            try
            {

                _database.AddInParameter(_command, "@In60codemp", System.Data.DbType.String, oIn60detalleSeg.In60codemp);
                _database.AddInParameter(_command, "@In60aa", System.Data.DbType.String, oIn60detalleSeg.In60aa);
                _database.AddInParameter(_command, "@In60Area", System.Data.DbType.String, oIn60detalleSeg.In60Area);
                _database.AddInParameter(_command, "@In60numped", System.Data.DbType.String, oIn60detalleSeg.In60numped);
                _database.AddInParameter(_command, "@In60NroIntento", System.Data.DbType.Int16, oIn60detalleSeg.In60NroIntento);
                _database.AddInParameter(_command, "@in60FlujoProceso", System.Data.DbType.Int16, oIn60detalleSeg.in60FlujoProceso);
                _database.ExecuteNonQuery(_command, oDbTransaction);

            }
            catch (Exception)
            {

                throw;
            }
        }
        public DataTable ListarDetallePedidoSeguimiento(In60detalleSeg oIn60detalleSeg)
        {
            _command = _database.GetStoredProcCommand("Usp_ControlPedido_Trae_PedParaAprobarDet");
            try
            {

                _database.AddInParameter(_command, "@In60codemp", System.Data.DbType.String, oIn60detalleSeg.In60codemp);
                _database.AddInParameter(_command, "@In60aa", System.Data.DbType.String, oIn60detalleSeg.In60aa);
                _database.AddInParameter(_command, "@In60numped", System.Data.DbType.String, oIn60detalleSeg.In60numped);
                _database.AddInParameter(_command, "@In60Area", System.Data.DbType.String, oIn60detalleSeg.In60Area);
                _database.AddInParameter(_command, "@in60FlujoProceso", System.Data.DbType.Int16, oIn60detalleSeg.in60FlujoProceso);

                DataTable dt;
                dt = _database.ExecuteDataSet(_command).Tables[0];

                return dt;

            }
            catch (Exception)
            {

                throw;
            }
        }
        public void DeshacerAprobacion(In60detalleSeg oIn60DetalleSeg)
        {
            MC.Enterprise.Data.TransactionML objTransactionML = null;
            try
            {
                objTransactionML = new MC.Enterprise.Data.TransactionML();
                objTransactionML.BeginTransaction();

                new PedidoDAL().DeshacerAprobacion(objTransactionML.GetTransaction(), oIn60DetalleSeg);

                objTransactionML.CommitTransaction();

            }
            catch (Exception)
            {
                objTransactionML.RollbackTransaction();
                throw;
            }
            finally
            {
                if (objTransactionML != null) objTransactionML.Dispose();
                objTransactionML = null;
            }
        }
        public void RegistrarDetallePedidoSeguimiento(In60detalleSeg oIn60detalleSeg)
        {
            MC.Enterprise.Data.TransactionML objTransactionML = null;
            try
            {
                objTransactionML = new MC.Enterprise.Data.TransactionML();
                objTransactionML.BeginTransaction();

                new PedidoDAL().RegistrarDetallePedidoSeguimiento(objTransactionML.GetTransaction(), oIn60detalleSeg);

                objTransactionML.CommitTransaction();

            }
            catch (Exception)
            {
                objTransactionML.RollbackTransaction();
                throw;
            }
            finally
            {
                if (objTransactionML != null) objTransactionML.Dispose();
                objTransactionML = null;
            }
        }
 public DataTable ListarPedidoSeguimientoxarea(In60detalleSeg oIn60detalleSeg , In60pedido oIn60pedido)
 {
     return new PedidoDAL().ListarCabeceraPedidoSeguimiento(oIn60detalleSeg, oIn60pedido);
 }
 public DataTable ListarDetallePedidoSeguimiento(In60detalleSeg oIn60detalleSeg)
 {
     return new PedidoDAL().ListarDetallePedidoSeguimiento(oIn60detalleSeg);
 }