public Category OpenAddCategoryWindow() { AddCategoryWindow win = new AddCategoryWindow(); if (win.ShowDialog() == true) { Category c = new Category() { Name = win.category.Text, Id = "0" }; return(c); } return(null); }
private void AddCategory_Click() { // Open temporary add category form AddCategoryWindow form = new AddCategoryWindow(); form.ShowDialog(); // If category is valid, at it to the DB if (form.MViewModel.IsCategoryValid) { // Create category EZBudgetDB.CreateCategory(LogedInUserID, form.MViewModel.CategoryName, form.MViewModel.CategoryDescription, form.MViewModel.CategoryColorTag, Math.Round(decimal.Parse(form.MViewModel.CategoryAmount), 2)); // TO BE CHANGED PopulateViewModel(); } }
private void AddCategory(object obj) { string category = ""; if (obj.Equals("##Region") || obj.Equals("##Themes")) { var addCategoryWindow = new AddCategoryWindow(); addCategoryWindow.ShowDialog(); if (!addCategoryWindow.IsCancelled) { category = addCategoryWindow.Category; MenuItem menuItem = ViewHelper.CreateMenuItem(AddCategoryCommand, category); if (obj.Equals("##Region")) { _regionsMenu.Items.Add(menuItem); } else { _themesMenu.Items.Add(menuItem); } } } else { category = obj.ToString(); } var articles = _articlesDataGrid.SelectedItems.OfType<Article>().ToList(); _commandManager.AddCategory(articles, category); Refresh(); }
private void button_CategoriesAdd_Click(object sender, RoutedEventArgs e) { AddCategoryWindow popup = new AddCategoryWindow(this.DataContext); popup.ShowDialog(); }
public void AddCategory() { AddCategoryWindow window = new AddCategoryWindow(); window.ShowDialog(); }