private void SetEditedOperationValues(OperationPattern operationPattern) { if (operationPattern.isExpense) { Expense_RadioButton.IsChecked = true; } else { Income_RadioButton.IsChecked = true; } CostValue.Text = NewOperation.ToCurrencyString(operationPattern.Cost); _acceptedCostValue = NewOperation.ToCurrencyWithoutSymbolString(operationPattern.Cost); NameValue.Text = operationPattern.Title; if (operationPattern is Operation && !string.IsNullOrEmpty(((Operation)operationPattern).Date)) { Operation operation = (Operation)operationPattern; DateValue.Date = DateTime.Parse(operation.Date); HideInStatisticsToggle.IsOn = !operation.VisibleInStatistics; } CategoryValue.SelectedItem = CategoryValue.Items.OfType <ComboBoxItem>().SingleOrDefault(i => i.Tag.ToString() == operationPattern.Category?.GlobalId); SubCategoryValue.SelectedItem = SubCategoryValue.Items.OfType <ComboBoxItem>().SingleOrDefault(item => item.Tag.ToString() == operationPattern.SubCategory?.GlobalId); // PayFormValue.SelectedItem = PayFormValue.Items.OfType<Account>().SingleOrDefault(item => item.Id == operationPattern.MoneyAccountId); if (!string.IsNullOrEmpty(operationPattern.MoreInfo)) { MoreInfoValue.Text = operationPattern.MoreInfo; } _isLoaded = true; }
private void CostValue_LostFocus(object sender, RoutedEventArgs e) { _isUnfocused = true; if (!string.IsNullOrEmpty(CostValue.Text)) { CostValue.Text = NewOperation.ToCurrencyString(CostValue.Text); } }
private void CostValue_LostFocus(object sender, RoutedEventArgs e) { _isUnfocused = true; if (CostValue.Text != "" && decimal.Parse(CostValue.Text) != 0.0m) { CostValue.Text = NewOperation.ToCurrencyString(CostValue.Text); } else { CostValue.Text = string.Empty; _acceptedCostValue = string.Empty; } }
private void CostValue_LostFocus(object sender, RoutedEventArgs e) { _isUnfocused = true; if (!string.IsNullOrEmpty(NewBalanceValue.Text)) { NewBalanceValue.Text = NewOperation.ToCurrencyString(NewBalanceValue.Text); } else { NewBalanceValue.Text = string.Empty; _acceptedCostValue = string.Empty; } }
public TestController() { //OperationDataContext context = new OperationDataContext(); context = new NewOperation(); }
public PublisherController() { context = new NewOperation(); }
public CustomerController() { context = new NewOperation(); }
public BookController() { context = new NewOperation(); }