Exemplo n.º 1
0
        private void BtnCreateCategory_Click(object sender, RoutedEventArgs e)
        {
            CategoryWindow categoryWindow = new CategoryWindow();

            categoryWindow.Show();
            categoryWindow.Closing += CategoryWindow_Closing;
        }
Exemplo n.º 2
0
        private void CategoryWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            CategoryWindow categoryWindow = new CategoryWindow();

            if (categoryWindow != null)
            {
                categoryWindow.Closing -= CategoryWindow_Closing;
            }

            InitializeCategories();
        }
Exemplo n.º 3
0
        private void BtnEditCategory_Click(object sender, RoutedEventArgs e)
        {
            OperationTypeDto category = GetClickedCategory(sender);

            CategoryWindow categoryWindow = new CategoryWindow();

            categoryWindow.Id = category.Id;
            categoryWindow.tbCategoryName.Text = category.Name;

            if (category.IsCredit)
            {
                categoryWindow.rbIncome.IsChecked = true;
            }
            else
            {
                categoryWindow.rbExpense.IsChecked = true;
            }

            categoryWindow.Show();
            categoryWindow.Closing += CategoryWindow_Closing;
        }