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=\"activityentry\">Pay ";
            html += "<span class=\"setvalue\">" + Amount.ToString("#,##0.##") + "</span> ";
            html += "<span class=\"setvalue\">" + PaymentStyle.ToString() + "</span> ";
            html += " from ";
            if (BankAccountName != null)
            {
                html += "<span class=\"resourcelink\">" + BankAccountName + "</span> ";
            }
            else
            {
                html += "<span class=\"errorlink\">[ACCOUNT NOT SET]</span> ";
            }
            html += "</div>";
            html += "\n<div class=\"activityentry\">This activity uses a category label ";
            if (Category != null && Category != "")
            {
                html += "<span class=\"setvalue\">" + Category + "</span> ";
            }
            else
            {
                html += "<span class=\"errorlink\">[NOT SET]</span> ";
            }
            html += " for all transactions</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)
 {
     using (StringWriter htmlWriter = new StringWriter())
     {
         htmlWriter.Write("\r\n<div class=\"activityentry\">Pay ");
         htmlWriter.Write("<span class=\"setvalue\">" + Amount.ToString("#,##0.00") + "</span> ");
         htmlWriter.Write("<span class=\"setvalue\">" + PaymentStyle.ToString() + "</span> from ");
         if (AccountName == null || AccountName == "")
         {
             htmlWriter.Write("<span class=\"errorlink\">[ACCOUNT NOT SET]</span>");
         }
         else
         {
             htmlWriter.Write("<span class=\"resourcelink\">" + AccountName + "</span>");
         }
         htmlWriter.Write("</div>");
         htmlWriter.Write("\r\n<div class=\"activityentry\">This activity uses a category label ");
         if (Category != null && Category != "")
         {
             htmlWriter.Write("<span class=\"setvalue\">" + Category + "</span> ");
         }
         else
         {
             htmlWriter.Write("<span class=\"errorlink\">[NOT SET]</span> ");
         }
         htmlWriter.Write(" for all transactions</div>");
         return(htmlWriter.ToString());
     }
 }
 /// <inheritdoc/>
 public override string ModelSummary()
 {
     using (StringWriter htmlWriter = new StringWriter())
     {
         htmlWriter.Write("\r\n<div class=\"activityentry\">Pay ");
         htmlWriter.Write("<span class=\"setvalue\">" + Amount.ToString("#,##0.##") + "</span> ");
         htmlWriter.Write("<span class=\"setvalue\">" + PaymentStyle.ToString() + "</span> from ");
         htmlWriter.Write(CLEMModel.DisplaySummaryValueSnippet(AccountName, "Account not set", HTMLSummaryStyle.Resource));
         htmlWriter.Write("</div>");
         return(htmlWriter.ToString());
     }
 }
        /// <summary>
        /// Validate object
        /// </summary>
        /// <param name="validationContext"></param>
        /// <returns></returns>
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            var results = new List <ValidationResult>();

            switch (PaymentStyle)
            {
            case AnimalPaymentStyleType.Fixed:
            case AnimalPaymentStyleType.perHead:
            case AnimalPaymentStyleType.perAE:
                break;

            default:
                string[] memberNames = new string[] { "PaymentStyle" };
                results.Add(new ValidationResult("Payment style " + PaymentStyle.ToString() + " is not supported", memberNames));
                break;
            }
            return(results);
        }
Beispiel #5
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\">Pay ";
            html += "<span class=\"setvalue\">" + Amount.ToString("#,##0.00") + "</span> ";
            html += "<span class=\"setvalue\">" + PaymentStyle.ToString() + "</span> from ";
            if (AccountName == null || AccountName == "")
            {
                html += "<span class=\"errorlink\">[ACCOUNT NOT SET]</span>";
            }
            else
            {
                html += "<span class=\"resourcelink\">" + AccountName + "</span>";
            }
            html += "</div>";
            return(html);
        }
Beispiel #6
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                htmlWriter.Write("\r\n<div class=\"activityentry\">Pay ");
                htmlWriter.Write("<span class=\"setvalue\">" + Amount.ToString("#,##0.##") + "</span> ");
                htmlWriter.Write("<span class=\"setvalue\">" + PaymentStyle.ToString() + "</span> ");
                htmlWriter.Write(" from ");

                htmlWriter.Write(CLEMModel.DisplaySummaryValueSnippet(BankAccountName, "Account not set", HTMLSummaryStyle.Resource));
                htmlWriter.Write("</div>");
                htmlWriter.Write("\r\n<div class=\"activityentry\">This activity uses a category label ");

                htmlWriter.Write(CLEMModel.DisplaySummaryValueSnippet(TransactionCategory, "Not set"));
                htmlWriter.Write(" for all transactions</div>");
                return(htmlWriter.ToString());
            }
        }