Exemple #1
0
        public IdentificationUnitAnalysisForm(IdentificationUnitAnalysis currentIUA)
            : this(true)
        {
            if (currentIUA != null)
            {
                this._iua = currentIUA;

                Cursor.Current = Cursors.WaitCursor;
                this.fillIUAData();
                Cursor.Current = Cursors.Default;
            }
            else
            {
                this.Close();
            }
        }
Exemple #2
0
            private void bottomUp(ISerializableObject iso, List <ISerializableObject> parents)
            {
                if (iso.GetType().Equals(typeof(IdentificationUnitAnalysis)))
                {
                    IdentificationUnitAnalysis iua = (IdentificationUnitAnalysis)iso;
                    IdentificationUnit         iu  = iua.IdentificationUnit;
                    if (iu != null)
                    {
                        parents.Add(iu);
                        bottomUp(iu, parents);
                    }
                    else
                    {
                        throw new Exception();
                    }
                }
                else if (iso.GetType().Equals(typeof(IdentificationUnit)))
                {
                    IdentificationUnit iu = (IdentificationUnit)iso;

                    /*
                     * IDirectAccessIterator<Identification> identifications = iu.Identifications;
                     * short i = 0;
                     * Identification ident = null;
                     * foreach (Identification id in identifications)
                     * {
                     *  if (id.IdentificationSequence != null && id.IdentificationSequence > i)
                     *  {
                     *      i = (short)id.IdentificationSequence;
                     *      ident = id;
                     *  }
                     * }
                     * if (ident != null)
                     *  parents.Add(ident);*/
                    IdentificationUnit relatedUnit = iu.RelatedUnit;
                    if (relatedUnit != null)
                    {
                        parents.Add(relatedUnit);
                        bottomUp(relatedUnit, parents);
                    }
                    else
                    {
                        CollectionSpecimen spec = iu.CollectionSpecimen;
                        if (spec != null)
                        {
                            parents.Add(spec);
                            bottomUp(spec, parents);
                        }
                        else
                        {
                            throw new Exception();
                        }
                    }
                }
                else if (iso.GetType().Equals(typeof(CollectionSpecimen)))
                {
                    CollectionSpecimen spec = (CollectionSpecimen)iso;
                    CollectionAgent    ca   = spec.CollectionAgent.First();
                    if (ca != null)
                    {
                        parents.Add(ca);
                    }
                    CollectionEvent ce = spec.CollectionEvent;
                    if (ce != null)
                    {
                        parents.Add(ce);
                        bottomUp(ce, parents);
                    }
                    else
                    {
                        this.root = spec;
                    };                      //Warnung dass das Specimen nicht angezeigt werden kann
                }
                else if (iso.GetType().Equals(typeof(CollectionEvent)))
                {
                    CollectionEvent ce = (CollectionEvent)iso;
                    IDirectAccessIterator <CollectionEventLocalisation> locations = ce.CollectionEventLocalisation;
                    foreach (CollectionEventLocalisation loc in locations)
                    {
                        parents.Add(loc);
                    }
                    IDirectAccessIterator <CollectionEventProperty> properties = ce.CollectionEventProperties;
                    foreach (CollectionEventProperty prop in properties)
                    {
                        parents.Add(prop);
                    }
                    CollectionEventSeries cs = ce.CollectionEventSeries;
                    if (cs != null)
                    {
                        parents.Add(cs);
                        this.root = cs;
                    }
                    else
                    {
                        this.root = ce;
                    }
                }
                else if (iso.GetType().Equals(typeof(CollectionEventSeries)))
                {
                    CollectionEventSeries cs = (CollectionEventSeries)iso;
                    this.root = cs;
                }
            }
 public IUAnalysisVM(IdentificationUnitAnalysis an)
     : base(an)
 {
 }