public IUAnalysisVM(IdentificationUnitAnalysis an)
     : base(an)
 {
 }
        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();
        }
        public TreeNode displayTopDownIUA(IdentificationUnitAnalysis iua)
        {
            TreeNode iuaNode = new TreeNode();
            if(iua != null)
                parametrizeIUANode(iua, iuaNode);

            return iuaNode;
        }
        public void parametrizeIUANode(IdentificationUnitAnalysis iua, TreeNode iuaNode)
        {
            if (iua != null && iuaNode != null)
            {
                Analysis analysis = iua.Analysis;

                StringBuilder text = new StringBuilder();

                text.Append(iua.AnalysisResult);

                if (analysis.MeasurementUnit != null && !analysis.MeasurementUnit.Equals(String.Empty))
                {
                    text.Append(" ");
                    text.Append(analysis.MeasurementUnit);
                }
                text.Append(": ");
                text.Append(analysis.DisplayText);

                iuaNode.Text = text.ToString();

                iuaNode.ImageIndex = iuaNode.SelectedImageIndex = (int)TreeViewIconIndex.Analysis;
                if (iuaNode.Tag == null)
                    iuaNode.Tag = new TreeViewNodeData(iua.IdentificationUnit.IdentificationUnitID, iua.IdentificationUnit.CollectionSpecimenID, iua.AnalysisID, iua.AnalysisNumber);
            }
        }
 public TreeNode displayBottomUpIdentificationUnitAnalysis(IdentificationUnitAnalysis iua)
 {
     TreeNode iuaNode = new TreeNode();
     TreeNode subRootNode = null;
     if (iua != null)
     {
         parametrizeIUANode(iua, iuaNode);
         IdentificationUnit iu = iua.IdentificationUnit;
         if (iu != null)
         {
             subRootNode = displayBottomUpIdentificationUnit(iu, iuaNode);
         }
         if (subRootNode != null)
         {
             return subRootNode;
         }
     }
     return iuaNode;
 }