/// <summary> /// remove createdCategory /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdTest2_Click(object sender, EventArgs e) { CategoryItem categoryItem = default(CategoryItem); //User must select a Category Item. categoryItem = MDSSController <MDSSModel> .SelectCategoryItem(SettingsController <Settings> .Settings.Sheets[0], "Type", "Select a Category Item to Add to existing Sheet Cells.", 0, false); if (categoryItem != null) { //_ValueChanging = true; //move it SettingsController <Settings> .Settings.Sheets[0].AssignCategory("Type", Category.SheetCategoryType.None, categoryItem); //_ValueChanging = false; //refresh //MDSSController<MDSSModel>.Refresh(); dgCells.DataSource = SettingsController <Settings> .Settings.Sheets[0].Cells; //returnValue = true; } //List<CategoryItem> sheetCategoryItems = new List<CategoryItem> { SettingsController<Settings>.Settings.Sheets[0].Categories.Find(c => c.Name == "Department").Items.Find(ci => ci.Name == "Belts") }; //List<SheetCell> cellsWithSelectedCategoryItem = (from cell in SettingsController<Settings>.Settings.Sheets[0].Cells // where sheetCategoryItems.All(ci1 => cell.CategoryItems.Any(ci2 => ci2 == ci1)) // select cell).ToList<SheetCell>(); //List<SheetCell> cellsWithUnSelectedCategoryItem = (from cell in SettingsController<Settings>.Settings.Sheets[0].Cells // where sheetCategoryItems.All(ci1 => cell.CategoryItems.Any(ci2 => ((ci2.Parent == ci1.Parent) && (ci2.Name != ci1.Name)))) // select cell).ToList<SheetCell>(); }
/// <summary> /// add createdCategory /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdTest1_Click(object sender, EventArgs e) { CategoryItem categoryItem = default(CategoryItem); //User must select a Category Item. categoryItem = MDSSController <MDSSModel> .SelectCategoryItem(SettingsController <Settings> .Settings.Sheets[0], "Type", "Select a Category Item to Add to existing Sheet Cells.", 0, false); if (categoryItem != null) { //_ValueChanging = true; //move it SettingsController <Settings> .Settings.Sheets[0].AssignCategory("Type", Category.SheetCategoryType.Y, categoryItem); //_ValueChanging = false; //refresh //MDSSController<MDSSModel>.Refresh(); dgCells.DataSource = SettingsController <Settings> .Settings.Sheets[0].Cells; //returnValue = true; } }