/// <summary> /// Add to Chart Command Method /// </summary> /// <param name="param"></param> private void AddCommandMethod(object param) { GadgetWithPeriodColumns entry = new GadgetWithPeriodColumns(); if (SelectedSeriesCB != null) { entry.GridId = null; entry.GadgetName = null; entry.GadgetDesc = SelectedSeriesCB; entry.Amount = null; entry.PeriodYear = null; ComparisonSeries.Add(entry); } List <COASpecificData> addItem = new List <COASpecificData>(); if (selectedCOASpecificGadgetNameInfo == null) { addItem = (COASpecificInfo.Where(t => t.GroupDescription == defaultGadgetDesc && t.Description == SelectedSeriesCB && t.PeriodYear != 2300)).ToList(); } else { addItem = (COASpecificInfo.Where(t => t.GroupDescription == selectedCOASpecificGadgetNameInfo && t.Description == SelectedSeriesCB && t.PeriodYear != 2300)).ToList(); } if (addItem != null) { foreach (COASpecificData r in addItem) { COASpecificFilteredInfo.Add(r); } } AddToComboBoxSeries.Remove(SelectedSeriesCB); }
/// <summary> /// Delete Series from Chart /// </summary> /// <param name="param"></param> private void DeleteCommandMethod(object param) { GadgetWithPeriodColumns a = param as GadgetWithPeriodColumns; List <COASpecificData> removeItem = new List <COASpecificData>(); removeItem = COASpecificFilteredInfo.Where(w => w.Description == a.GadgetDesc).ToList(); if (removeItem != null) { foreach (COASpecificData r in removeItem) { COASpecificFilteredInfo.Remove(r); } } ComparisonSeries.Remove(a); AddToComboBoxSeries.Add(a.GadgetDesc); }