private void ExecuteDelete(object parameter)
        {
            IMessageBoxService msg        = new MessageBoxService();
            string             title      = "Deleting Industry Segment - Application";
            string             confirmtxt = "Do you want to delete the selected item";

            if (IndustrySegmentApplications.Where(x => x.IsChecked).Count() > 1)
            {
                title      = title + "s";
                confirmtxt = confirmtxt + "s";
            }

            if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK))
            {
                foreach (IndustrySegmentApplicationJoinModel si in IndustrySegmentApplications)
                {
                    if (si.IsChecked)
                    {
                        if (si.ID > 0)
                        {
                            DeleteIndustrySegmentApplication(si.ID);
                        }
                        deleteditems.Add(si);
                    }
                }

                foreach (IndustrySegmentApplicationJoinModel pm in deleteditems)
                {
                    IndustrySegmentApplications.Remove(pm);
                }
                deleteditems.Clear();
                CheckValidation();
            }
            msg = null;
        }
        private bool IsDuplicateName()
        {
            var query = IndustrySegmentApplications.GroupBy(x => x.IndustrySegmentID.ToString() + "-" + x.ApplicationID.ToString())
                        .Where(g => g.Count() > 1)
                        .Select(y => y.Key)
                        .ToList();

            return(query.Count > 0);
        }
 private void IndustrySegmentApplications_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e)
 {
     if (e.PropertyName != "IsChecked")
     {
         CheckValidation();
         isdirty = true;
     }
     IsSelected = IndustrySegmentApplications.Where(x => x.IsChecked).Count() > 0;
 }
        private void ExecuteAddNew(object parameter)
        {
            IndustrySegmentApplications.Add(new IndustrySegmentApplicationJoinModel()
            {
                ID                = 0,
                Name              = string.Empty,
                Description       = string.Empty,
                IndustrySegmentID = 0,
                ApplicationID     = 0,
                IsChecked         = false,
                IsEnabled         = true
            });

            ScrollToIndex = IndustrySegmentApplications.Count() - 1;
            CheckValidation();
        }
        private bool IsApplicationMissing()
        {
            int nummissing = IndustrySegmentApplications.Where(x => x.ApplicationID == 0).Count();

            return(nummissing > 0);
        }