Exemple #1
0
        /// <summary>
        /// Select Project Command through command interface
        /// </summary>
        private void SelectProject(Object p)
        {
            ProjectModel selectedProject = GetProject((int)p);

            Globals.Project_ID         = (int)p;
            Globals.ProjectSelected    = true;
            ProjectSelected            = true;
            Globals.ProjectName        = selectedProject.ProjectName;
            Globals.ContractNo         = selectedProject.ContractNo;
            selectedProject.LastOpened = DateTime.Now;

            // Store the current DateTime in the selected project record so it can be used to sort the project list
            EDBEntities eDB = new EDBEntities();
            tblProject  Rec = eDB.tblProjects.Where(o => o.ID == selectedProject.ID).FirstOrDefault();

            Rec.LastOpened   = selectedProject.LastOpened;
            Rec.LastOpenedBy = Environment.UserName;
            eDB.SaveChanges();

            IsBackStageOpen = false;
            MainTitle       = Globals.ContractNo + Globals.ProjectName;
            TypeViewModelLocator.GetTypeVM();
            ObjectViewModelLocator.GetObjectVM();
            TemplateViewModelLocator.GetTemplateVM();
            PropertyViewModelLocator.GetPropertyVM();
            AspectViewModelLocator.GetAspectVM();
            AttributeViewModelLocator.GetAttributeVM();
            ObjectAssociationViewModelLocator.GetObjectAssociationVM();
            ObjectRequirementViewModelLocator.GetObjectRequirementVM();
            TemplateAssociationViewModelLocator.GetTemplateAssociationVM();
            TemplateRequirementViewModelLocator.GetTemplateRequirementVM();
        }
 public PropertyView()
 {
     InitializeComponent();
     DataContext = PropertyViewModelLocator.GetPropertyVM();
     AspectListView.DataContext    = AspectViewModelLocator.GetAspectVM();
     AttributeListView.DataContext = AttributeViewModelLocator.GetAttributeVM();
 }
        public void LoadCBAttributes()
        {
            AttributeViewModel attributeVM = AttributeViewModelLocator.GetAttributeVM();

            CBAttributes.Clear();
            foreach (var item in attributeVM.Attributes)
            {
                CBAttributes.Add(item);
            }
        }