Exemplo n.º 1
0
 public TaxonTooltipContent(User user, int taxonId)
 {
     InitializeComponent();
     TaxonID = taxonId;
     User = user;
     Loaded += new RoutedEventHandler(TaxonTooltipContent_Loaded);
 }
 public DistributionRegionTooltipContent(User user, int regionId)
 {
     InitializeComponent();
     this.User = user;
     this.DistRegionID = regionId;
     Loaded += new RoutedEventHandler(DistributionRegionTooltipContent_Loaded);
 }
Exemplo n.º 3
0
 public AddNewTraitWindow(User user, TraitCategoryType category)
 {
     InitializeComponent();
     this.User = user;
     this.TraitCategory = category;
     txtTraitName.BindUser(user, PickListType.Trait, null, category);
 }
Exemplo n.º 4
0
 public NameListAdminControl(User user, string nameListType)
     : base(user)
 {
     InitializeComponent();
     this.Type = nameListType;
     lstTypeData.MouseRightButtonUp += new MouseButtonEventHandler(lstTypeData_MouseRightButtonUp);
 }
        public GenusAvailableNameControl(TaxonViewModel taxon, User user)
            : base(taxon, user, "GenusAvailableNames")
        {
            InitializeComponent();

            txtReference.BindUser(user, LookupType.Reference);
            txtNameStatus.BindUser(user, PickListType.Phrase, "GAN Name Status", TraitCategoryType.Taxon);
            txtFixationMethod.BindUser(user, PickListType.Phrase, "Fixation Method", TraitCategoryType.Taxon);

            var data = Service.GetGenusAvailableName(taxon.TaxaID.Value);
            if (data == null) {
                data = new GenusAvailableName();
                data.BiotaID = taxon.TaxaID.Value;
            }
            _model = new GenusAvailableNameViewModel(data);

            this.DataContext = _model;
            _model.DataChanged += new DataChangedHandler((vm) => {
                RegisterUniquePendingChange(new UpdateGenusAvailableNameCommand(_model.Model));
                EnableTabs();
            });

            LoadIncludedSpeciesModel();

            EnableTabs();

            // The "insert included species" stored proc does not return the new identity for the
            // included species record, so we need to reload the model on update to get the ids...
            this.ChangesCommitted += new PendingChangesCommittedHandler((s) => {
                LoadIncludedSpeciesModel();
            });
        }
Exemplo n.º 6
0
 public TaxonStatisticsReport(User user, TaxonViewModel taxon)
     : base(user, taxon)
 {
     RegisterViewer(new TabularDataViewerSource());
     DefineColumn("Category");
     DefineColumn("Count");
 }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        public QueryTool(User user, ToolsPlugin owner)
        {
            CommandBindings.Add(new CommandBinding(AddCriteria, ExecutedAddCriteria, CanExecuteAddCriteria));
            CommandBindings.Add(new CommandBinding(RemoveCriteria, ExecutedRemoveCriteria, CanExecuteRemoveCriteria));
            CommandBindings.Add(new CommandBinding(RemoveAllCriteria, ExecutedRemoveAllCriteria, CanExecuteRemoveAllCriteria));
            CommandBindings.Add(new CommandBinding(MoveCriteriaUp, ExecutedMoveCriteriaUp, CanExecuteMoveCriteriaUp));
            CommandBindings.Add(new CommandBinding(MoveCriteriaDown, ExecutedMoveCriteriaDown, CanExecuteMoveCriteriaDown));
            CommandBindings.Add(new CommandBinding(NewQuery, ExecutedNewQuery, CanExecuteNewQuery));
            CommandBindings.Add(new CommandBinding(OpenQuery, ExecutedOpenQuery, CanExecuteOpenQuery));
            CommandBindings.Add(new CommandBinding(SaveQuery, ExecutedSaveQuery, CanExecuteSaveQuery));
            CommandBindings.Add(new CommandBinding(ShowSQL, ExecutedShowSQL, CanExecuteShowSQL));
            CommandBindings.Add(new CommandBinding(ExecuteQuery, ExecutedExecuteQuery, CanExecuteExecuteQuery));

            ExecuteQuery.InputGestures.Add(new KeyGesture(Key.F5, ModifierKeys.Control));

            InitializeComponent();
            User = user;
            Owner = owner;

            var service = new SupportService(user);
            _fields = service.GetFieldMappings();
            lvwFields.ItemsSource = _fields;

            var myView = (CollectionView)CollectionViewSource.GetDefaultView(lvwFields.ItemsSource);
            var groupDescription = new PropertyGroupDescription("Category");
            if (myView.GroupDescriptions != null) {
                myView.GroupDescriptions.Add(groupDescription);
            }

            _model = new ObservableCollection<QueryCriteria>();
            criteriaGrid.ItemsSource = _model;

            var sortItems = new List<String>(new[] { CriteriaSortConverter.NOT_SORTED, "Ascending", "Descending" });
            sortColumn.ItemsSource = sortItems;
        }
Exemplo n.º 9
0
        public JournalDetails(User user, int journalID)
            : base(user, "Journal:" + journalID)
        {
            InitializeComponent();
            Journal model = null;

            if (journalID >= 0) {
                var service = new SupportService(user);
                model = service.GetJournal(journalID);
            } else {
                model = new Journal();
                model.JournalID = -1;
                model.FullName = "<New Journal>";
            }

            _viewModel = new JournalViewModel(model);

            _traits = tabJournal.AddTabItem("Traits", new TraitControl(user, TraitCategoryType.Journal, _viewModel));
            _notes = tabJournal.AddTabItem("Notes", new NotesControl(user, TraitCategoryType.Journal, _viewModel));
            tabJournal.AddTabItem("Ownership", new OwnershipDetails(model));

            if (_viewModel.JournalID >= 0) {
                _viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged);
            } else {
                Loaded += new RoutedEventHandler(JournalDetails_Loaded);
                _traits.IsEnabled = false;
                _notes.IsEnabled = false;
            }

            ChangesCommitted += new PendingChangesCommittedHandler(JournalDetails_ChangesCommitted);

            this.DataContext = _viewModel;
        }
Exemplo n.º 10
0
 public ContactDetails(User user, int contactId)
     : base(user, "LoanContact:" + contactId)
 {
     InitializeComponent();
     _contactId = contactId;
     this.ChangeContainerSet += new Action(ContactDetails_ChangeContainerSet);
 }
Exemplo n.º 11
0
 public void BindUser(User user, string autoNumberCategory, string table, string field)
 {
     this.AutoNumberCategory = autoNumberCategory;
     this.AutoNumberTable = table;
     this.AutoNumberField = field;
     this.User = user;
 }
Exemplo n.º 12
0
 public NoteControl(User user, NoteViewModel model)
 {
     InitializeComponent();
     this.User = user;
     Model = model;
     this.DataContext = model;
     txtNote.SelectionChanged += new RoutedEventHandler(txtNote_SelectionChanged);
 }
Exemplo n.º 13
0
 public TaxaForDistributionRegionReport(User user, DistributionRegion distRegion, int taxonId = -1)
     : base(user)
 {
     this.TaxonID = taxonId;
     this.DistributionRegion = distRegion;
     RegisterViewer(new RTFReportViewerSource());
     var service = new SupportService(user);
 }
Exemplo n.º 14
0
 public LabelSetReport(User user, LabelSet labelSet, List<LabelSetItem> items, IEnumerable<QueryCriteria> criteria)
     : base(user)
 {
     this.Criteria = criteria;
     this.Items = items;
     this.LabelSet = labelSet;
     RegisterViewer(new TabularDataViewerSource());
 }
Exemplo n.º 15
0
 public MultimediaReport(User user, ViewModelBase target, TraitCategoryType lookupType)
     : base(user)
 {
     Target = target;
     ObjectType = lookupType;
     RegisterViewer(new TabularDataViewerSource());
     RegisterViewer(new MultimediaThumbnailViewerSource());
 }
Exemplo n.º 16
0
 public TaxonRefLinksControl(User user, int referenceID)
     : base(user)
 {
     InitializeComponent();
     txtRefType.BindUser(User, PickListType.RefLinkType, "", TraitCategoryType.Taxon);
     txtTaxon.BindUser(User, LookupType.Taxon);
     this.ReferenceID = referenceID;
 }
Exemplo n.º 17
0
 public ChangeContainerControl(User user)
     : base()
 {
     this.User = user;
     _impl = new ChangeContainerImpl(user);
     _impl.ChangeRegistered += new PendingChangedRegisteredHandler(_impl_ChangeRegistered);
     _impl.ChangesCommitted += new PendingChangesCommittedHandler(_impl_ChangesCommitted);
 }
Exemplo n.º 18
0
        public ReferenceLinksReport(User user)
            : base(user)
        {
            RegisterViewer(new ReferenceBibliographyViewerSource());
            RegisterViewer(new TabularDataViewerSource());

            Options = new ReferencesReportOptions();
        }
Exemplo n.º 19
0
        public TraitControl(User user, TraitCategoryType category, ViewModelBase owner, bool RDEMode = false)
            : base(user, "Traits:" + category.ToString() + ":" + (owner == null ? -1 : owner.ObjectID.Value))
        {
            this.TraitCategory = category;
            this.Owner = owner;
            _rdeMode = RDEMode;

            InitializeComponent();
        }
Exemplo n.º 20
0
 public OverdueLoansControl(User user, ToolsPlugin plugin)
 {
     InitializeComponent();
     this.User = user;
     this.Plugin = plugin;
     lvw.MouseDoubleClick += new MouseButtonEventHandler(lvw_MouseDoubleClick);
     lvw.PreviewMouseRightButtonUp += new MouseButtonEventHandler(lvw_PreviewMouseRightButtonUp);
     Loaded += new RoutedEventHandler(OverdueLoansControl_Loaded);
 }
Exemplo n.º 21
0
        public CommonNamesControl(TaxonViewModel taxon, User user)
            : base(taxon, user, "CommonNames")
        {
            InitializeComponent();

            txtReference.BindUser(user, LookupType.Reference);
            lstNames.SelectionChanged += new SelectionChangedEventHandler(lstNames_SelectionChanged);

            ChangesCommitted += new PendingChangesCommittedHandler(CommonNamesControl_ChangesCommitted);
        }
Exemplo n.º 22
0
        public PhraseManager(User user)
            : base(user, "PhraseManager")
        {
            InitializeComponent();
            ReloadModel();

            ChangesCommitted += new PendingChangesCommittedHandler((source) => {
                ReloadModel();
            });
        }
Exemplo n.º 23
0
        public ContactBrowsePage(User user)
        {
            InitializeComponent();
            lvw.MouseRightButtonUp += new MouseButtonEventHandler(lvw_MouseRightButtonUp);

            ListViewDragHelper.Bind(lvw, ListViewDragHelper.CreatePinnableGenerator(ToolsPlugin.TOOLS_PLUGIN_NAME, LookupType.Contact));

            this.User = user;
            lvw.ItemsSource = _model;
        }
Exemplo n.º 24
0
 public AdministrationControl(User user)
     : base(user, "AdminControl")
 {
     InitializeComponent();
     this.User = user;
     tabControl.AddTabItem("Trait types", new TraitTypesControl(user, "trait"));
     tabControl.AddTabItem("Note types", new TraitTypesControl(user, "note"));
     tabControl.AddTabItem("Ref Link types", new NameListAdminControl(user, "ref"));
     tabControl.AddTabItem("Multimedia Link types", new NameListAdminControl(user, "mm"));
 }
Exemplo n.º 25
0
 public override bool DisplayOptions(User user, System.Windows.Window parentWindow)
 {
     if (Options != null) {
         if (Options.Owner == null) {
             Options.Owner = parentWindow;
         }
         return Options.ShowDialog() == true;
     }
     return false;
 }
Exemplo n.º 26
0
 public BVPImportOptionsWindow(User user, BVPImportOptions options)
 {
     InitializeComponent();
     this.DataContext = this;
     this.User = user;
     this.Options = options;
     Filename = "";
     if (options != null && !String.IsNullOrEmpty(options.Filename)) {
         Filename = options.Filename;
     }
 }
Exemplo n.º 27
0
        public AddToLabelSet(User user, int materialId)
        {
            InitializeComponent();
            this.User = user;
            this.MaterialID = materialId;

            Loaded +=new RoutedEventHandler(AddToLabelSet_Loaded);

            optExisting.Checked += new RoutedEventHandler(optExisting_Checked);
            optNewLabelSet.Checked += new RoutedEventHandler(optNewLabelSet_Checked);
        }
Exemplo n.º 28
0
        public GenerateLoanFormControl(User user, ToolsPlugin plugin, int loanId)
        {
            InitializeComponent();

            User = user;
            Plugin = plugin;
            LoanID = loanId;

            lvw.MouseDoubleClick += lvw_MouseDoubleClick;

            Loaded += GenerateLoanFormControl_Loaded;
        }
Exemplo n.º 29
0
 public MaterialForTaxonReport(User user, TaxonViewModel taxon)
     : base(user, taxon)
 {
     RegisterViewer(new TabularDataViewerSource());
     DefineColumn("BiotaFullName", "Taxa");
     DefineColumn("FullRegion", "Region");
     DefineColumn("Local", "Locality");
     DefineColumn("FormattedLatLong", "Lat/Long");
     DefineColumn("Collectors");
     DefineColumn("Dates");
     DefineColumn("AccessionNo", "Accession No.");
 }
Exemplo n.º 30
0
        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));
            }
        }