public OrderWindow(HomeAccounting ha, Order order = null) { InitializeComponent(); this.ha = ha; ComboBoxCategories.ItemsSource = ha.Categories; ComboBoxFamilyMembers.ItemsSource = ha.FamilyMembers; if (order != null) { orderId = order.Id; ComboBoxCategories.SelectedIndex = ha.Categories.IndexOf(ha.Categories.FirstOrDefault(c => c.Id == order.CategoryId)); ComboBoxFamilyMembers.SelectedIndex = ha.Categories.IndexOf(ha.Categories.First(fm => fm.Id == order.FamilyMemberId)); DatePickerDate.SelectedDate = order.Date; TextBoxDescription.Text = order.Description; TextBoxPrice.Text = order.Price.ToString(); Title = "Редагування операції"; ButtonOk.Content = "Зберегти"; IsEdit = true; } else { DatePickerDate.SelectedDate = DateTime.Now; Title = "Додавання операції"; ButtonOk.Content = "Додати"; IsEdit = false; } }
public FamilyMembersWindow(HomeAccounting ha) { InitializeComponent(); this.ha = ha; ListBoxFamilyMembers.ItemsSource = familyMembers = new ObservableCollection <FamilyMember>(); UpdateListBoxFamilyMembers(); }
public BalanceUserControl(HomeAccounting ha) { InitializeComponent(); this.ha = ha; fuc = new FiltersUserControl(ha); GridFilters.Children.Add(fuc); ha.FiltersUpdated += UpdateListBoxBalance; }
public CategoriesWindow(HomeAccounting ha) { InitializeComponent(); this.ha = ha; ListBoxCategories.ItemsSource = categories = new ObservableCollection <Category>(); UpdateListBoxCategories(); ListBoxCategories_SelectionChanged(null, null); }
public static void Main() { List<ExpensesIncomes> e; try { e = HomeAccounting.Load("homeaccounting.txt"); } catch (Exception) { e = new List<ExpensesIncomes>(); } string[] options = {"Add new Expense", "Show records for category and dates","Search Expense", "Modify record","Delete record","Sort records", "Normalize descriptions"}; char option; do { Console.WriteLine("MENU"); for (int i = 0; i < options.Length; i++) { Console.WriteLine("{0}. {1}", i + 1, options[i]); } Console.WriteLine("T. Exit"); Console.Write("Select Option: "); option = Convert.ToChar(Console.ReadLine()); switch (option) { case 'T': Console.WriteLine("Good Bye!!!"); break; case '1': AddExpense(e); break; case '2': ShowRecords(e); break; case '3': SearchExpense(e); break; case '4': ModifyRecord(e); break; case '5': DeleteRecord(e); break; case '6': SortRecord(e); break; case '7': NormalizeDescriptions(e); break; default: Console.WriteLine("Unknown option"); break; } Console.WriteLine(); } while (option != 'T'); HomeAccounting.Save("homeaccounting.txt", e); }
public RegistrationWindow(HomeAccounting ha) { InitializeComponent(); this.ha = ha; }
public static void Main() { HomeAccounting myHomeAccounting = new HomeAccounting(); myHomeAccounting.Run(); }
public AuthenticationWindow() { InitializeComponent(); ha = new HomeAccounting(); }