private void ExecuteDelete(object parameter) { IMessageBoxService msg = new MessageBoxService(); string title = "Deleting Miscellaneous Data"; string confirmtxt = "Do you want to delete the selected item"; if (MiscellaneousData.Where(x => x.IsChecked).Count() > 1) { confirmtxt = confirmtxt + "s"; } if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK)) { foreach (MiscellaneousDataModel si in MiscellaneousData) { if (si.IsChecked) { if (si.ID > 0) { DeleteMiscellaneousData(si.ID); } deleteditems.Add(si); } } foreach (MiscellaneousDataModel pm in deleteditems) { MiscellaneousData.Remove(pm); } deleteditems.Clear(); CheckValidation(); } msg = null; }
private void MiscellaneousData_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e) { if (e.PropertyName != "IsChecked") { CheckValidation(); isdirty = true; } IsSelected = MiscellaneousData.Where(x => x.IsChecked).Count() > 0; }
private bool IsDuplicateName() { var query = MiscellaneousData.GroupBy(x => x.FKID.ToString() + "-" + x.Name) .Where(g => g.Count() > 1) .Select(y => y.Key) .ToList(); return(query.Count > 0); }
private void ExecuteAddNew(object parameter) { MiscellaneousData.Add(new MiscellaneousDataModel() { ID = 0, FKID = 0, Name = string.Empty, IsChecked = false, IsEnabled = true }); ScrollToIndex = MiscellaneousData.Count() - 1; CheckValidation(); }
SwapBack(MiscellaneousData, index, TeamCount);
private bool IsLabelMissing() { int nummissing = MiscellaneousData.Where(x => string.IsNullOrEmpty(x.Name)).Count(); return(nummissing > 0); }
private bool IsProjectTypeMissing() { int nummissing = MiscellaneousData.Where(x => x.FKID == 0).Count(); return(nummissing > 0); }