Beispiel #1
0
        private static void RemoveItemClicked(object sender, RoutedEventArgs e)
        {
            WPFDbContext.Instance.RemoveItemType = (ItemTypeEnum)Enum.Parse(typeof(ItemTypeEnum), (string)(sender as DependencyObject).GetValue(RemoveItemClickedProperty));
            switch (WPFDbContext.Instance.RemoveItemType)
            {
            case ItemTypeEnum.Category:
                WPFCategoryDao.SaveTempSelectedIndex();
                CategoryDao.Remove(WPFDbContext.Instance.SelectedCategory.ID);
                WPFCategoryDao.GetCategories();
                WPFCategoryDao.GetCategoryFromTempSelectedIndex();
                break;

            case ItemTypeEnum.ParameterName:
                int id = (WPFDbContext.Instance.UnusedTaskVisibility == Visibility.Collapsed) ? WPFDbContext.Instance.SelectedUsedParameter.ID : WPFDbContext.Instance.SelectedUnusedParameter.ID;
                ParameterNameDao.Remove(id);
                WPFParameterNameDao.Update();
                break;

            case ItemTypeEnum.Task:
                WPFTaskDao.SaveTempSelectedIndex();
                TaskDao.Remove(WPFDbContext.Instance.SelectedUnusedTask.ID);
                WPFTaskDao.GetTasks();
                WPFParameterNameDao.Update();
                break;
            }
        }
Beispiel #2
0
        private static void CategorySelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBox comboBox = sender as ComboBox;

            if (comboBox.SelectedIndex == -1)
            {
                return;
            }
            Category cate = (sender as ComboBox).SelectedItem as Category;

            WPFParameterNameDao.Update();
        }
Beispiel #3
0
        private static void AddParameterClicked(object sender, RoutedEventArgs e)
        {
            if (WPFDbContext.Instance.UnusedTaskVisibility == Visibility.Collapsed)
            {
                return;
            }
            if (WPFDbContext.Instance.SelectedUnusedParameter == null)
            {
                return;
            }
            ParameterBindingDao.Insert(WPFDbContext.Instance.SelectedUnusedTask.ID, WPFDbContext.Instance.SelectedCategory.ID, WPFDbContext.Instance.SelectedUnusedParameter.ID);

            WPFParameterNameDao.Update();
        }