public void ShowLogs(TreeVM tree)
 {
     if (tree.TrySave())
     {
         this.ViewController.ShowLogsView(tree.Stratum, tree);
     }
     else
     {
         ViewController.ShowMessage("Unable to save tree. Ensure Tree Number, Sample Group and Stratum are valid"
             , null, MessageBoxIcon.Hand);
     }
 }
 //protected bool ProcessSampleGroupChanging(TreeVM tree, SampleGroupVM newSG)
 //{
 //    if (tree == null || newSG == null) { return false; }
 //    if (tree.SampleGroup != null)
 //    {
 //        if (MessageBox.Show("You are changing the Sample Group of a tree, are you sure you want to do this?", "!", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2)
 //            == DialogResult.No)
 //        {
 //            return false;
 //        }
 //        else
 //        {
 //            this.AppController._cDal.LogMessage(String.Format("Tree Sample Group Changed (Cu:{0} St:{1} Sg:{2} -> {3} Tdv_CN:{4} T#: {5}",
 //                tree.CuttingUnit.Code,
 //                tree.Stratum.Code,
 //                (tree.SampleGroup != null) ? tree.SampleGroup.Code : "?",
 //                newSG.Code,
 //                (tree.TreeDefaultValue != null) ? tree.TreeDefaultValue.TreeDefaultValue_CN.ToString() : "?",
 //                tree.TreeNumber), "high");
 //            tree.SampleGroup = newSG;
 //        }
 //    }
 //    else
 //    {
 //        tree.SampleGroup = newSG;
 //    }
 //    if (tree.TreeDefaultValue != null)
 //    {
 //        var hasTDV = tree.DAL.ExecuteScalar<bool>("SELECT count(1) " +
 //            "FROM SampleGroupTreeDefaultValue " +
 //            "WHERE TreeDefaultValue_CN = ? AND SampleGroup_CN"
 //            , tree.TreeDefaultValue_CN, newSG.SampleGroup_CN);
 //        if (!hasTDV)
 //        {
 //            tree.SetTreeTDV(null);
 //        }
 //    }
 //    return tree.TrySave();
 //}
 protected bool ProcessSpeciesChanged(TreeVM tree, TreeDefaultValueDO tdv)
 {
     if (tree == null) { return true; }
     if (tree.TreeDefaultValue == tdv) { return true; }
     tree.SetTreeTDV(tdv);
     return tree.TrySave();
 }
 public bool HandleSpeciesChanged(TreeVM tree, TreeDefaultValueDO tdv)
 {
     if (tree == null) { return true; }
     //if (tree.TreeDefaultValue == tdv) { return true; }
     tree.SetTreeTDV(tdv);
     return tree.TrySave();
 }