private void AddProject(object obj)
        {
            if (ConfigProjectsCollection.Where(e => e.ProjectName.ToLower().Equals(NewProjectName.ToLower())).Any())
            {
                MessageBox.Show("Provided project already exists!");
                return;
            }

            var newConfigProjectsLibId = configProjectsLibRepository.AddNewConfigProjectsLib(NewProjectName);
            //nweConfigAreaid configArearepositoer.where.name==notAssigned
            var newConfigProjectId = configProjectRepository.AddNewConfigProjects(newConfigProjectsLibId, ConfigAreasCollection.Where(e => e.AreaName.Equals("Not assigned")).FirstOrDefault().ID);

            //ad new configprojectid (newConfigProjectsLibId, nweConfigAreaid)
            ConfigProjectsCollection.Add
            (
                new ConfigProject()
            {
                ID = newConfigProjectId,

                AreaName           = "Not assigned",
                ConfigAreaID       = ConfigAreasCollection.Where(e => e.AreaName.Equals("Not assigned")).FirstOrDefault().ID,
                ConfigProjectLibID = newConfigProjectsLibId,
                ProjectName        = NewProjectName,
                JdUploaded         = false,
                Selected           = true
            }
            );
            ConfigProjectsCollection = ConfigProjectsCollection.OrderBy(e => e.ProjectName).ToObservableCollection();

            ConfigProjectsLib configProjectsLib = new ConfigProjectsLib()
            {
                Id = newConfigProjectsLibId, ProjectName = NewProjectName, Selected = true
            };

            ///send congifdPorjecr
            configProjectMessenger.RaiseConfigProjectChanged(ConfigProjectsCollection.Where(e => e.ID == newConfigProjectId).FirstOrDefault());
        }
Esempio n. 2
0
        public void UpdateConfigProjectsLib(ConfigProjectsLib configProjectsLib)
        {
            ConfigProjectsLib configProjectsLibToUpdate = ConfigProjectsLibs.Where(e => e.Id.Equals(configProjectsLib.Id)).FirstOrDefault();

            configProjectsLibToUpdate = configProjectsLib;
        }
Esempio n. 3
0
 public void DeleteConfigProjectsLib(ConfigProjectsLib configProjectsLib)
 {
     ConfigProjectsLibs.Remove(configProjectsLib);
 }