private void BtnCategory_Click(object sender, RoutedEventArgs e) { FeeCategoryId = 1; LblCategory.Content = string.Empty; var winSelectFeeCategory = new WinSelectFeeCategory(); winSelectFeeCategory.ShowDialog(); FeeCategoryId = winSelectFeeCategory.Id; if (FeeCategoryId == 0) { LblCategory.Content = "نامشخص"; FeeCategoryId = 1; LblCategory.Foreground = Brushes.Red; return; } LblCategory.Content = winSelectFeeCategory.CategoryGroup + " : " + winSelectFeeCategory.Category; LblCategory.Foreground = FeeCategoryId == 1 ? Brushes.Red : Brushes.Green; }
private void BtnCategory_Click(object sender, RoutedEventArgs e) { if (RdoIncome.IsChecked == true) { IncomeCategoryId = 1; LblCategory.Content = string.Empty; var winSelectIncomeCategory = new WinSelectIncomeCategory(); winSelectIncomeCategory.ShowDialog(); IncomeCategoryId = winSelectIncomeCategory.Id; if (IncomeCategoryId == 0) { LblCategory.Content = "همه دسته بندیها"; IncomeCategoryId = 1; LblCategory.Foreground = Brushes.Red; return; } LblCategory.Content = winSelectIncomeCategory.CategoryGroup + " : " + winSelectIncomeCategory.Category; LblCategory.Foreground = IncomeCategoryId == 1 ? Brushes.Red : Brushes.Green; } else if (RdoFee.IsChecked == true) { FeeCategoryId = 1; LblCategory.Content = string.Empty; var winSelectFeeCategory = new WinSelectFeeCategory(); winSelectFeeCategory.ShowDialog(); FeeCategoryId = winSelectFeeCategory.Id; if (FeeCategoryId == 0) { LblCategory.Content = "همه دسته بندیها"; FeeCategoryId = 1; LblCategory.Foreground = Brushes.Red; return; } LblCategory.Content = winSelectFeeCategory.CategoryGroup + " : " + winSelectFeeCategory.Category; LblCategory.Foreground = FeeCategoryId == 1 ? Brushes.Red : Brushes.Green; } else { LblCategory.Content = "همه دسته بندیها"; } }