void checkheader_OnCheckBoxHeaderClick(CheckBoxHeaderCellEventArgs e)
        {
            double aplica = 0; int pos = 0;

            if (Dgv.Rows.Count > 0)
            {
                foreach (DataGridViewRow item in Dgv.Rows)
                {
                    Dgv.BeginEdit(true);
                    item.Cells[""].Value = e.IsChecked;
                    pos = item.Cells[0].RowIndex;
                    if (Convert.ToBoolean(item.Cells[""].Value) == true)
                    {
                        aplica += Convert.ToDouble(item.Cells["dgvbalance"].Value);
                        Dgv.Rows[pos].Cells["dgvaplicar"].Value = Funciones.Fun_Convierte_String_aDecimal(Convert.ToString(item.Cells["dgvbalance"].Value)).ToString("N2");
                    }
                    else if (Convert.ToBoolean(item.Cells[""].Value) == false)
                    {
                        Dgv.Rows[pos].Cells["dgvaplicar"].Value = "";
                    }
                    Dgv.EndEdit();
                }
                Txtaplicar.Text = aplica + "";
            }
        }
 private void ExportHeaderCell_OnCheckBoxHeaderClick(CheckBoxHeaderCellEventArgs e)
 {
     foreach (var pattern in RegexPatterns)
     {
         pattern.ShouldEnable = e.IsChecked;
     }
     Settings.EnableAll     = e.IsChecked;
     Settings.RegexPatterns = RegexPatterns;
 }
Beispiel #3
0
 void loCheckheader_OnCheckBoxHeaderClick(CheckBoxHeaderCellEventArgs e)
 {
     if (gvMovimientosCorrectos.Rows.Count > 0)
     {
         gvMovimientosCorrectos.BeginEdit(true);
         foreach (DataGridViewRow loFila in gvMovimientosCorrectos.Rows)
         {
             loFila.Cells[0].Value = e.IsChecked;
         }
     }
     gvMovimientosCorrectos.EndEdit();
 }
Beispiel #4
0
 void checkheader_OnCheckBoxHeaderClick(CheckBoxHeaderCellEventArgs e)
 {
     if (gridBase1.Rows.Count > 0)
     {
         gridBase1.BeginEdit(true);
         foreach (DataGridViewRow item in gridBase1.Rows)
         {
             if (item.Visible == true)
             {
                 item.Cells[""].Value = e.IsChecked;
             }
         }
         gridBase1.EndEdit();
     }
 }
        void checkheader_OnCheckBoxHeaderClick(CheckBoxHeaderCellEventArgs e)
        {
            double aplica   = 0;
            double deposito = Funciones.Fun_Convierte_String_aDecimal(Txtdeposito.Text);
            double balance  = Funciones.Fun_Convierte_String_aDecimal(Txtbalance.Text);

            if (Dgv.Rows.Count > 0)
            {
                if (Rbnreciboingreso.Checked)
                {
                    Dgv.BeginEdit(true);

                    foreach (DataGridViewRow item in Dgv.Rows)
                    {
                        item.Cells[""].Value = e.IsChecked;

                        if (Convert.ToBoolean(item.Cells[""].Value))
                        {
                            aplica += Funciones.Fun_Convierte_String_aDecimal(Convert.ToString(item.Cells["dgvbalance"].Value));


                            item.Cells["dgvaplicar"].Value      = Funciones.Fun_Convierte_String_aDecimal(Convert.ToString(item.Cells["dgvbalance"].Value)).ToString("N2");
                            item.Cells["dgvbalancefinal"].Value = "0.00";
                        }

                        else
                        {
                            item.Cells["dgvaplicar"].Value = string.Empty;
                        }
                        item.Cells["dgvbalancefinal"].Value   = string.Empty;
                        item.Cells["dgvdescuento"].Value      = string.Empty;
                        item.Cells["dgvcargo"].Value          = string.Empty;
                        item.Cells["dgvretencionitbis"].Value = string.Empty;
                        item.Cells["dgvretencionisr"].Value   = string.Empty;
                    }
                }
                else if (Rbnaplicardeposito.Checked)
                {
                    if (balance > deposito)
                    {
                        aplica = deposito;
                    }
                    else
                    {
                        aplica = balance;
                    }

                    foreach (DataGridViewRow item in Dgv.Rows)
                    {
                        if (deposito > 0)
                        {
                            item.Cells[""].Value = e.IsChecked;
                        }

                        if (Convert.ToBoolean(item.Cells[""].Value) == true)
                        {
                            if (deposito >= Funciones.Fun_Convierte_String_aDecimal(Convert.ToString(item.Cells["dgvbalance"].Value)))
                            {
                                deposito -= Convert.ToDouble(item.Cells["dgvbalance"].Value);
                                item.Cells["dgvaplicar"].Value      = Convert.ToDouble(item.Cells["dgvbalance"].Value);
                                item.Cells["dgvbalancefinal"].Value = Convert.ToDouble(item.Cells["dgvbalance"].Value) - Convert.ToDouble(item.Cells["dgvaplicar"].Value);
                            }

                            else if (deposito < Convert.ToDouble(item.Cells["dgvbalance"].Value) && deposito > 0)
                            {
                                item.Cells["dgvaplicar"].Value      = deposito;
                                item.Cells["dgvbalancefinal"].Value = Convert.ToDouble(item.Cells["dgvbalance"].Value) - Convert.ToDouble(item.Cells["dgvaplicar"].Value);
                                deposito = 0;
                            }
                        }
                        else if (Convert.ToBoolean(item.Cells[""].Value) == false)
                        {
                            item.Cells["dgvaplicar"].Value        = string.Empty;
                            item.Cells["dgvbalancefinal"].Value   = string.Empty;
                            item.Cells["dgvdescuento"].Value      = string.Empty;
                            item.Cells["dgvcargo"].Value          = string.Empty;
                            item.Cells["dgvretencionitbis"].Value = string.Empty;
                            item.Cells["dgvretencionisr"].Value   = string.Empty;

                            if (Funciones.Fun_Convierte_String_aDecimal(Txtaplicar.Text) == 0)
                            {
                                aplica = 0;
                            }
                        }
                    }
                }



                Fun_Calcular_Totales();

                Dgv.EndEdit();
            }
        }