private void UltraGrid_OrdenGiro_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            try
            {
                decimal valorApli = Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(ValorAplicado));
                if (e.Column.FieldName == "valorAplicado")
                {
                    if (valorApli > Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2)))
                    {
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(ValorAplicado, Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2)));
                    }

                    UltraGrid_OrdenGiro.SetFocusedRowCellValue(saldo, Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2)) - Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(ValorAplicado)));

                    if (valorApli > 0)
                    {
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(Chek, true);
                    }
                    else
                    {
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(Chek, false);
                    }

                    SumaOG();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void UltraGrid_OrdenGiro_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            try
            {
                if (_Accion != Cl_Enumeradores.eTipo_action.grabar)
                {
                    decimal saldos = Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2));
                    if ((bool)UltraGrid_OrdenGiro.GetFocusedRowCellValue(Chek))
                    {
                        decimal sal = Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2));
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(saldo, sal);
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(ValorAplicado, 0);

                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(Chek, false);
                    }
                    else
                    {
                        UltraGrid_OrdenGiro.SetFocusedRowCellValue(Chek, true);
                        if (txt_diferencia.EditValue == null)
                        {
                            UltraGrid_OrdenGiro.SetFocusedRowCellValue(Chek, false);
                        }
                        else
                        {
                            if (saldos > Convert.ToDecimal(txt_diferencia.EditValue))
                            {
                                UltraGrid_OrdenGiro.SetFocusedRowCellValue(ValorAplicado, txt_diferencia.EditValue);
                            }
                            else
                            {
                                UltraGrid_OrdenGiro.SetFocusedRowCellValue(ValorAplicado, Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2)));
                            }

                            UltraGrid_OrdenGiro.SetFocusedRowCellValue(saldo, Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(saldo2)) - Convert.ToDecimal(UltraGrid_OrdenGiro.GetFocusedRowCellValue(ValorAplicado)));
                        }
                    }


                    SumaOG();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }