Пример #1
0
 public AddWindow(string facultyName)
 {
     associatedName   = facultyName;
     newProj          = new ResearchProject(associatedName);
     this.DataContext = newProj;
     InitializeComponent();
 }
Пример #2
0
        public EditWindow(string facultyName, ResearchProject project)
        {
            associatedName   = facultyName;
            currentProj      = project;
            this.DataContext = currentProj;

            InitializeComponent();
        }
Пример #3
0
 internal void RemoveProject(ResearchProject proj)
 {
     try
     {
         ResearchProject toRemove = Projects.Single(x => x.Equals(proj));
         Projects.Remove(toRemove);
     }
     catch (Exception)
     {
         CloseStorage();
         throw;
     }
 }
Пример #4
0
 internal void UpdateProject(ResearchProject proj)
 {
     try
     {
         Projects.Remove(Projects.Single(x => x.AssociatedFaculty == proj.AssociatedFaculty && x.LastModified == proj.LastModified));
         proj.LastModified = DateTime.Now;
         AddProject(proj);
     }
     catch (Exception)
     {
         CloseStorage();
         throw;
     }
 }
Пример #5
0
 internal void AddProject(ResearchProject proj)
 {
     if (!Projects.Contains(proj))
     {
         try
         {
             Projects.Add(proj);
         }
         catch (Exception)
         {
             CloseStorage();
             throw;
         }
     }
 }