Exemple #1
0
        private void CostoNumericUpDown_ValueChanged_1(object sender, EventArgs e)
        {
            decimal costo    = Convert.ToInt32(CostoNumericUpDown.Value);
            decimal precio   = Convert.ToInt32(PrecioNumericUpDown.Value);
            decimal ganancia = Convert.ToDecimal(GananciaNumericUpDown.Value);

            if (CostoNumericUpDown.Value < PrecioNumericUpDown.Value && GananciaNumericUpDown.Value == 0)
            {
                GananciaNumericUpDown.Value = ArticulosBLL.CalcularGanancia(costo, costo);
            }
            if (CostoNumericUpDown.Value > 0 && GananciaNumericUpDown.Value > 0 && PrecioNumericUpDown.Value == 0)
            {
                PrecioNumericUpDown.Value = ArticulosBLL.CalcularPrecio(costo, ganancia);
            }
        }