Esempio n. 1
0
        private void ExecuteDelete(object parameter)
        {
            IMessageBoxService msg        = new MessageBoxService();
            string             title      = "Deleting Project Type";
            string             confirmtxt = "Do you want to delete the selected item";

            if (ProjectTypes.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 (ProjectTypeModel si in ProjectTypes)
                {
                    if (si.IsChecked)
                    {
                        if (si.ID > 0)
                        {
                            DeleteProjectType(si.ID);
                        }
                        deleteditems.Add(si);
                    }
                }

                foreach (ProjectTypeModel pm in deleteditems)
                {
                    ProjectTypes.Remove(pm);
                }
                deleteditems.Clear();
                CheckValidation();
            }
            msg = null;
        }
Esempio n. 2
0
 private void ProjectTypes_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e)
 {
     if (e.PropertyName != "IsChecked")
     {
         CheckValidation();
         isdirty = true;
     }
     IsSelected = ProjectTypes.Where(x => x.IsChecked).Count() > 0;
 }
Esempio n. 3
0
        private bool IsColourMissing()
        {
            int nummissing = ProjectTypes.Where(x => string.IsNullOrEmpty(x.Colour.Trim())).Count();

            return(nummissing > 0);
        }
Esempio n. 4
0
        private bool DescriptionMissing()
        {
            int nummissing = ProjectTypes.Where(x => string.IsNullOrEmpty(x.Description.Trim())).Count();

            return(nummissing > 0);
        }