Пример #1
0
 private void TbPvpCImposto_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (tbPvpCImposto.Text.Length != 0 && tbPvpCImposto.Text.Substring(tbPvpCImposto.Text.Length - 1, 1) != ",")
     {
         tbPvpSImposto.TextChanged -= this.TbPvpSImposto_TextChanged;
         if (TextBoxValidator((TextBox)sender) && cbImpostos.SelectedItem != null && tbPvpCImposto.Text.Length != 0)
         {
             double  preco   = double.Parse(tbPvpCImposto.Text);
             Imposto imposto = (Imposto)cbImpostos.SelectedItem;
             tbPvpSImposto.Text = string.Format("{0:#0.00}", Calculos.DecrementaImposto(preco, imposto.Taxa));
         }
         tbPvpSImposto.TextChanged += this.TbPvpSImposto_TextChanged;
     }
 }