Beispiel #1
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=\"activitybannerlight\">Breeding females</div>";
            html += "\n<div class=\"activitycontentlight\">";
            html += "\n<div class=\"activityentry\">";
            html += "The herd will be maintained ";
            if (MinimumBreedersKept == MaximumBreedersKept)
            {
                html += "at <span class=\"setvalue\">" + MinimumBreedersKept.ToString("#,###") + "</span> individual" + ((MinimumBreedersKept != 1)?"s":"");
            }
            else
            {
                html += ((MinimumBreedersKept > 0) ? "between <span class=\"setvalue\">" + MinimumBreedersKept.ToString("#,###") + "</span> and " : "below ") + "<span class=\"setvalue\">" + MaximumBreedersKept.ToString("#,###") + "</span>";
            }
            html += "</div>";
            html += "\n<div class=\"activityentry\">";
            html += "Individuals will be sold when over <span class=\"setvalue\">" + MaximumBreederAge.ToString("###") + "</span> months old";
            html += "</div>";
            if (MaximumProportionBreedersPerPurchase < 1)
            {
                html += "\n<div class=\"activityentry\">";
                html += "A maximum of <span class=\"setvalue\">" + MaximumProportionBreedersPerPurchase.ToString("#0.##%") + "</span> of the Maximum Breeders Kept can be purchased in a single transaction";
                html += "</div>";
            }
            html += "</div>";

            html += "\n<div class=\"activitybannerlight\">Breeding males (sires/rams etc)</div>";
            html += "\n<div class=\"activitycontentlight\">";
            html += "\n<div class=\"activityentry\">";
            if (MaximumSiresKept == 0)
            {
                html += "No breeding sires will be kept";
            }
            else if (MaximumSiresKept < 1)
            {
                html += "The number of breeding males will be determined as <span class=\"setvalue\">" + MaximumSiresKept.ToString("###%") + "</span> of the maximum female breeder herd. Currently <span class=\"setvalue\">" + (Convert.ToInt32(Math.Ceiling(MaximumBreedersKept * MaximumSiresKept), CultureInfo.InvariantCulture).ToString("#,##0")) + "</span> individuals";
            }
            else
            {
                html += "A maximum of <span class=\"setvalue\">" + MaximumSiresKept.ToString("#,###") + "</span> will be kept";
            }
            html += "</div>";
            html += "\n<div class=\"activityentry\">";
            html += "Individuals will be sold when over <span class=\"setvalue\">" + MaximumBullAge.ToString("###") + "</span> months old";
            html += "</div>";
            html += "</div>";

            html += "\n<div class=\"activitybannerlight\">General herd</div>";
            html += "\n<div class=\"activitycontentlight\">";
            if (MaleSellingAge + MaleSellingWeight > 0)
            {
                html += "\n<div class=\"activityentry\">";
                html += "Males will be sold when <span class=\"setvalue\">" + MaleSellingAge.ToString("###") + "</span> months old or <span class=\"setvalue\">" + MaleSellingWeight.ToString("#,###") + "</span> kg";
                html += "</div>";
                if (ContinuousMaleSales)
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Animals will be sold in any month";
                    html += "</div>";
                }
                else
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Animals will be sold only when activity is due";
                    html += "</div>";
                }
                if (SellFemalesLikeMales)
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Females will be sold the same as males";
                    html += "</div>";
                }
            }
            else
            {
                html += "\n<div class=\"activityentry\">";
                html += "There are no age or weight sales of individuals.";
                html += "</div>";
            }
            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>";

            return(html);
        }
        /// <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=\"activitybannerlight\">Breeding females</div>";
            html += "\n<div class=\"activitycontentlight\">";
            html += "\n<div class=\"activityentry\">";

            int maxBreed = Math.Max(MinimumBreedersKept, MaximumBreedersKept);

            html += "The herd will be maintained";
            if (MinimumBreedersKept == 0)
            {
                html += " using only natural recruitment up to <span class=\"setvalue\">" + MaximumBreedersKept.ToString("#,###") + "</span> breeders";
            }
            else if (MinimumBreedersKept == maxBreed)
            {
                html += " with breeder purchases and natural recruitment up to <span class=\"setvalue\">" + MinimumBreedersKept.ToString("#,###") + "</span > breeders";
            }
            else
            {
                html += " with breeder purchases up to <span class=\"setvalue\">" + MinimumBreedersKept.ToString("#,###") + "</span > and natural recruitment to <span class=\"setvalue\">" + maxBreed.ToString("#,###") + "</span> breeders";
            }
            html += "</div>";

            html += "\n<div class=\"activityentry\">";
            html += "Individuals will be sold when over <span class=\"setvalue\">" + MaximumBreederAge.ToString("###") + "</span> months old";
            html += "</div>";
            if (MaximumProportionBreedersPerPurchase < 1 & MinimumBreedersKept > 0)
            {
                html += "\n<div class=\"activityentry\">";
                html += "A maximum of <span class=\"setvalue\">" + MaximumProportionBreedersPerPurchase.ToString("#0.##%") + "</span> of the Minimum Breeders Kept can be purchased in a single transaction";
                html += "</div>";
            }
            html += "</div>";

            html += "\n<div class=\"activitybannerlight\">Breeding males (sires/rams etc)</div>";
            html += "\n<div class=\"activitycontentlight\">";
            html += "\n<div class=\"activityentry\">";
            if (MaximumSiresKept == 0)
            {
                html += "No breeding sires will be kept";
            }
            else if (MaximumSiresKept < 1)
            {
                html += "The number of breeding males will be determined as <span class=\"setvalue\">" + MaximumSiresKept.ToString("###%") + "</span> of the maximum female breeder herd. Currently <span class=\"setvalue\">" + (Convert.ToInt32(Math.Ceiling(MaximumBreedersKept * MaximumSiresKept), CultureInfo.InvariantCulture).ToString("#,##0")) + "</span> individuals";
            }
            else
            {
                html += "A maximum of <span class=\"setvalue\">" + MaximumSiresKept.ToString("#,###") + "</span> will be kept";
            }
            html += "</div>";
            html += "\n<div class=\"activityentry\">";
            html += "Individuals will be sold when over <span class=\"setvalue\">" + MaximumSireAge.ToString("###") + "</span> months old";
            html += "</div>";
            html += "</div>";

            html += "\n<div class=\"activitybannerlight\">General herd</div>";
            html += "\n<div class=\"activitycontentlight\">";
            if (MaleSellingAge + MaleSellingWeight > 0)
            {
                html += "\n<div class=\"activityentry\">";
                html += "Males will be sold when <span class=\"setvalue\">" + MaleSellingAge.ToString("###") + "</span> months old or <span class=\"setvalue\">" + MaleSellingWeight.ToString("#,###") + "</span> kg";
                html += "</div>";
                if (ContinuousMaleSales)
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Animals will be sold in any month";
                    html += "</div>";
                }
                else
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Animals will be sold only when activity is due";
                    html += "</div>";
                }
                if (SellFemalesLikeMales)
                {
                    html += "\n<div class=\"activityentry\">";
                    html += "Females will be sold the same as males";
                    html += "</div>";
                }
            }
            else
            {
                html += "\n<div class=\"activityentry\">";
                html += "There are no age or weight sales of individuals.";
                html += "</div>";
            }
            html += "</div>";

            html += "\n<div class=\"activityentry\">";
            html += "Purchased breeders will be placed in ";
            if (GrazeFoodStoreNameBreeders == null || GrazeFoodStoreNameBreeders == "")
            {
                html += "<span class=\"resourcelink\">General yards</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + GrazeFoodStoreNameBreeders + "</span>";
                if (MinimumPastureBeforeRestock > 0)
                {
                    html += " with no restocking while pasture is below <span class=\"activityentry\">" + MinimumPastureBeforeRestock.ToString() + "</span>";
                }
            }
            html += "</div>";

            html += "\n<div class=\"activityentry\">";
            html += "Purchased sires will be placed in ";
            if (GrazeFoodStoreNameSires == null || GrazeFoodStoreNameSires == "")
            {
                html += "<span class=\"resourcelink\">General yards</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + GrazeFoodStoreNameSires + "</span>";
                if (MinimumPastureBeforeRestock > 0)
                {
                    html += " with no restocking while pasture is below <span class=\"activityentry\">" + MinimumPastureBeforeRestock.ToString() + "</span>";
                }
            }
            html += "</div>";
            return(html);
        }