Exemplo n.º 1
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                htmlWriter.Write("\r\n<div class=\"activityentry\">Trade individuals are kept for ");
                htmlWriter.Write("<span class=\"setvalue\">" + MinMonthsKept.ToString("#0.#") + "</span> months");
                if (TradeWeight > 0)
                {
                    htmlWriter.Write(" or until");
                    htmlWriter.Write("<span class=\"setvalue\">" + TradeWeight.ToString("##0.##") + "</span> kg");
                }
                htmlWriter.Write("</div>");

                htmlWriter.Write("\r\n<div class=\"activityentry\">");
                htmlWriter.Write("Purchased individuals will be placed in ");
                if (GrazeFoodStoreName == null || GrazeFoodStoreName == "")
                {
                    htmlWriter.Write("<span class=\"resourcelink\">General yards</span>");
                }
                else
                {
                    htmlWriter.Write("<span class=\"resourcelink\">" + GrazeFoodStoreName + "</span>");
                }

                htmlWriter.Write("</div>");

                Relationship numberRelationship = this.FindAllChildren <Relationship>().FirstOrDefault() as Relationship;
                if (numberRelationship != null)
                {
                    htmlWriter.Write("\r\n<div class=\"activityentry\">");
                    if (GrazeFoodStoreName != null && !GrazeFoodStoreName.StartsWith("Not specified"))
                    {
                        htmlWriter.Write("The relationship <span class=\"activitylink\">" + numberRelationship.Name + "</span> will be used to calculate numbers purchased based on pasture biomass (t\\ha)");
                    }
                    else
                    {
                        htmlWriter.Write("The number of individuals in the Ruminant Cohort supplied will be used as no paddock has been supplied for the relationship <span class=\"resourcelink\">" + numberRelationship.Name + "</span> will be used to calulate numbers purchased based on pasture biomass (t//ha)");
                    }

                    htmlWriter.Write("</div>");
                }
                return(htmlWriter.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Provides the description of the model settings for summary (GetFullSummary)
        /// </summary>
        /// <param name="formatForParentControl">Use full verbose description</param>
        /// <returns></returns>
        public override string ModelSummary(bool formatForParentControl)
        {
            string html = "";

            html += "\n<div class=\"activityentry\">Trade individuals are kept for ";
            html += "<span class=\"setvalue\">" + MinMonthsKept.ToString("#0.#") + "</span> months";
            if (TradeWeight > 0)
            {
                html += " or until";
                html += "<span class=\"setvalue\">" + TradeWeight.ToString("##0.##") + "</span> kg";
            }
            html += "</div>";

            html += "\n<div class=\"activityentry\">";
            html += "Purchased individuals will be placed in ";
            if (GrazeFoodStoreName == null || GrazeFoodStoreName == "")
            {
                html += "<span class=\"resourcelink\">General yards</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + GrazeFoodStoreName + "</span>";
            }
            html += "</div>";

            Relationship numberRelationship = Apsim.Children(this, typeof(Relationship)).FirstOrDefault() as Relationship;

            if (numberRelationship != null)
            {
                html += "\n<div class=\"activityentry\">";
                if (GrazeFoodStoreName != null && !GrazeFoodStoreName.StartsWith("Not specified"))
                {
                    html += "The relationship <span class=\"activitylink\">" + numberRelationship.Name + "</span> will be used to calculate numbers purchased based on pasture biomass (t\\ha)";
                }
                else
                {
                    html += "The number of individuals in the Ruminant Cohort supplied will be used as no paddock has been supplied for the relationship <span class=\"resourcelink\">" + numberRelationship.Name + "</span> will be used to calulate numbers purchased based on pasture biomass (t//ha)";
                }
                html += "</div>";
            }
            return(html);
        }