using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LightSwitch;
namespace LightSwitchApplication
{
 public partial class Schulung
 {

  partial void Dauer_Compute(ref int result)
  {
   result = (int)(this.Ende - this.Beginn).TotalDays + 1;
  }

  partial void Preis_Validate(EntityValidationResultsBuilder results)
  {
   if (this.Preis < (this.Dauer * 400))
   {
    results.AddPropertyError("Preis zu gering. Mindestpreis sind 400 Euro pro Tag!");
   }
  }
 }
}
