コード例 #1
0
 private void BtnCambiar_Click(object sender, EventArgs e)
 {
     if (DGVenta.Rows.Count != 0)
     {
         foreach (DataGridViewRow row in DGVenta.Rows)
         {
             if (cbcampoamodificar.Text != "" && txtPorcentaje.Text != "")
             {
                 if (cbcampoamodificar.Text == "Precio_compra")
                 {
                     row.Cells[3].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(txtPorcentaje.Text)), 2);
                 }
                 if (cbcampoamodificar.Text == "Utilidad")
                 {
                     row.Cells[4].Value = UtilityFrm.formateodecimal(Convert.ToDecimal(txtPorcentaje.Text), 2);
                 }
                 if (cbcampoamodificar.Text == "Flete")
                 {
                     row.Cells[5].Value = UtilityFrm.formateodecimal(Convert.ToDecimal(txtPorcentaje.Text), 2);
                 }
                 if (cbcampoamodificar.Text == "Precio_venta")
                 {
                     row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularpreciocosto(Convert.ToDecimal(row.Cells[6].Value), Convert.ToDecimal(txtPorcentaje.Text)), 2);
                 }
             }
         }
     }
     refrescar();
 }
コード例 #2
0
        private void btnAplicar_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGVenta.Rows.Count != 0)
                {
                    foreach (DataGridViewRow row in DGVenta.Rows)
                    {
                        row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(row.Cells[4].Value), Convert.ToDecimal(row.Cells[5].Value), Convert.ToDecimal(row.Cells[6].Value)), 2);
                    }

                    if (UtilityFrm.mensajeopcionsiono("Desea aplicar los cambios?") == true)
                    {
                        DataTable tablaArticulos = GrillaADataTable(DGVenta);
                        string    respuesta      = NegocioArticulo.editarPrecioMasivo(tablaArticulos);
                        UtilityFrm.mensajeConfirm("La actualizacion se realizo con exito");
                        DGVenta.Rows.Clear();
                    }
                }
            }
            catch (Exception s)
            {
                UtilityFrm.mensajeError(s.Message);
            }
        }
コード例 #3
0
 private void refrescar()
 {
     if (DGVenta.Rows.Count != 0)
     {
         foreach (DataGridViewRow row in DGVenta.Rows)
         {
             row.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(row.Cells[3].Value), Convert.ToDecimal(row.Cells[4].Value), Convert.ToDecimal(row.Cells[5].Value), Convert.ToDecimal(row.Cells[6].Value)), 2);
         }
     }
 }
コード例 #4
0
 private void calcularutilidadgrid( )
 {
     DGVenta.CurrentRow.Cells[6].Value = UtilityFrm.formateodecimal(UtilityFrm.calcularventa(Convert.ToDecimal(DGVenta.CurrentRow.Cells[3].Value), Convert.ToDecimal(DGVenta.CurrentRow.Cells[4].Value), Convert.ToDecimal(DGVenta.CurrentRow.Cells[5].Value), Convert.ToDecimal(DGVenta.CurrentRow.Cells[6].Value)), 2);
 }