private void txtDiscount_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(txtDiscount.Text) && int.Parse(txtDiscount.Text.Replace(",", "")) > 0) { var price = long.Parse(txtDiscount.Text.Replace(",", "")); lblDiscount.Content = NumberToString.NumToString(price.ToString()) + " ریال"; txtDiscount.Text = price.ToString("N0"); txtDiscount.SelectionStart = txtDiscount.Text.Length; txtDiscount.SelectionLength = 0; } else { lblDiscount.Content = ""; } CalculateDiscount(); }
private void txtRevocationPrice_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(txtRevocationPrice.Text)) { var price = long.Parse(txtRevocationPrice.Text.Replace(",", "")); txtRevocationPrice.Text = price.ToString("N0"); lblRevocationPriceText.Content = NumberToString.NumToString(price.ToString()) + " ریال"; txtRevocationPrice.SelectionStart = txtRevocationPrice.Text.Length; txtRevocationPrice.SelectionLength = 0; } else { lblRevocationPriceText.Content = ""; } }