public MaterialRDEControl(User user) { InitializeComponent(); this.User = user; txtIdentification.BindUser(user, LookupType.Taxon); txtClassifiedBy.BindUser(User, "tblMaterial", "vchrIDBy"); txtAccessionNo.BindUser(User, "MaterialAccessionNo", "tblMaterial", "vchrAccessionNo"); txtRegistrationNo.BindUser(User, "MaterialRegNo", "tblMaterial", "vchrRegNo"); txtCollectorNo.BindUser(User, "MaterialCollectorNo", "tblMaterial", "vchrCollectorNo"); txtSource.BindUser(user, PickListType.Phrase, "Material Source", TraitCategoryType.Material); txtInstitution.BindUser(user, PickListType.Phrase, "Institution", TraitCategoryType.Material); txtCollectionMethod.BindUser(user, PickListType.Phrase, "Collection Method", TraitCategoryType.Material); txtMacroHabitat.BindUser(user, PickListType.Phrase, "Macro Habitat", TraitCategoryType.Material); txtMicroHabitat.BindUser(user, PickListType.Phrase, "Micro Habitat", TraitCategoryType.Material); txtTrap.BindUser(User, LookupType.Trap); _traits = new TraitControl(user, TraitCategoryType.Material, null, true); tabTraits.Content = _traits; _subpartsFull = new MaterialPartsControl(user, null, true); tabSubparts.Content = _subpartsFull; _associates = new OneToManyControl(new AssociatesOneToManyController(user, TraitCategoryType.Material, null), true); tabAssociates.Content = _associates; _multimedia = new MultimediaControl(User, TraitCategoryType.Material, null); tabMultimedia.Content = _multimedia; this.IsEnabled = false; this.DataContextChanged += new DependencyPropertyChangedEventHandler(MaterialRDEControl_DataContextChanged); }
public CurationEventsControl(User user, int materialID, MaterialPartsControl partsControl) : base(user, "CurationEvents:" + materialID) { InitializeComponent(); _partsControl = partsControl; MaterialID = materialID; detailsGrid.IsEnabled = false; lstEvents.SelectionChanged += new SelectionChangedEventHandler(lstEvents_SelectionChanged); txtEventType.BindUser(user, PickListType.Phrase, "Event Type", TraitCategoryType.Material); txtCurator.BindUser(user, PickListType.Phrase, "Curator", TraitCategoryType.Material); if (partsControl != null) { LoadPartNames(); partsControl.Model.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Model_CollectionChanged); } ChangesCommitted += new PendingChangesCommittedHandler(CurationEventsControl_ChangesCommitted); }
public MaterialDetails(User user, int materialID, bool readOnly) : base(user, "Material:" + materialID) { InitializeComponent(); var service = new MaterialService(user); var model = service.GetMaterial(materialID); _viewModel = new MaterialViewModel(model); _viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged); this.DataContext = _viewModel; this.IsReadOnly = readOnly; // General tab txtAccessionNumber.BindUser(User, "MaterialAccessionNo", "tblMaterial", "vchrAccessionNo"); txtRegistrationNumber.BindUser(User, "MaterialRegNo", "tblMaterial", "vchrRegNo"); txtCollectorNo.BindUser(User, "MaterialCollectorNo", "tblMaterial", "vchrCollectorNo"); txtAbundance.BindUser(user, PickListType.Phrase, "Material Abundance", TraitCategoryType.Material); txtSource.BindUser(user, PickListType.Phrase, "Material Source", TraitCategoryType.Material); txtInstitution.BindUser(user, PickListType.Phrase, "Institution", TraitCategoryType.Material); txtCollectionMethod.BindUser(user, PickListType.Phrase, "Collection Method", TraitCategoryType.Material); txtMacroHabitat.BindUser(user, PickListType.Phrase, "Macro Habitat", TraitCategoryType.Material); txtMicroHabitat.BindUser(user, PickListType.Phrase, "Micro Habitat", TraitCategoryType.Material); txtTrap.BindUser(User, LookupType.Trap); // Identification tab txtIdentification.BindUser(User, LookupType.Taxon, LookupOptions.TaxonExcludeAvailableNames); txtIdentification.ObjectIDChanged += new ObjectIDChangedHandler(txtIdentification_ObjectIDChanged); txtIdentifiedBy.BindUser(User, "tblMaterial", "vchrIDBy"); txtReference.BindUser(User, LookupType.Reference); txtAccuracy.BindUser(User, PickListType.Phrase, "Identification Accuracy", TraitCategoryType.Material); txtMethod.BindUser(User, PickListType.Phrase, "Identification Method", TraitCategoryType.Material); txtNameQual.BindUser(User, PickListType.Phrase, "Identification Qualifier", TraitCategoryType.Material); _historyControl = new IdentificationHistoryControl(user, materialID); _historyControl.Margin = new Thickness(0); tabIDHistory.Content = _historyControl; var partsControl = new MaterialPartsControl(User, _viewModel) { IsReadOnly = readOnly }; tabMaterial.AddTabItem("Subparts", partsControl); tabMaterial.AddTabItem("Associates", new OneToManyControl(new AssociatesOneToManyController(User, TraitCategoryType.Material, _viewModel)) { IsReadOnly = readOnly }); tabMaterial.AddTabItem("Events", new CurationEventsControl(User, materialID, partsControl)); tabMaterial.AddTabItem("Labels", new MaterialLabelsControl(_viewModel)); tabMaterial.AddTabItem("Traits", new TraitControl(User, TraitCategoryType.Material, _viewModel) { IsReadOnly = readOnly }); tabMaterial.AddTabItem("Notes", new NotesControl(User, TraitCategoryType.Material, _viewModel) { IsReadOnly = readOnly }); tabMaterial.AddTabItem("Multimedia", new MultimediaControl(User, TraitCategoryType.Material, _viewModel) { IsReadOnly = readOnly }); tabMaterial.AddTabItem("Ownership", new OwnershipDetails(model)); if (!model.IsTemplate) { tabMaterial.AddTabItem("Summary", new MaterialSummary(User, _viewModel)); } }