Beispiel #1
0
 public Divers_Logbook(decimal dive_number, string dive_location, decimal dive_depth, Dive_Type dive_type)
 {
     if (string.IsNullOrWhiteSpace(dive_location))
     {
         throw new ArgumentException("Dive Location must not be empty.", nameof(dive_location));
     }
     if (dive_depth < 0)
     {
         throw new ArgumentException("Dive Depth must not be or negative.", nameof(dive_depth));
     }
     Dive_Number     = dive_number;
     p_Dive_Location = dive_location;
     p_Dive_Depth    = dive_depth;
     Dive_Type       = dive_type;
 }
Beispiel #2
0
 /// <summary>
 /// Public Method
 /// Updates the dive.
 /// </summary>
 /// <param name="newdive_number">Newdive number.</param>
 /// <param name="newdive_location">Newdive location.</param>
 /// <param name="newdive_depth">Newdive depth.</param>
 /// <param name="newdive_type">Newdive type.</param>
 public void Update_Dive(decimal newdive_number, string newdive_location, decimal newdive_depth, Dive_Type newdive_type)
 {
     if (newdive_number < 0)
     {
         throw new ArgumentException("Dive Depth must not be or negative.", nameof(newdive_number));
     }
     if (string.IsNullOrWhiteSpace(newdive_location))
     {
         throw new ArgumentException("Dive Location must not be empty.", nameof(newdive_location));
     }
     if (newdive_depth < 0)
     {
         throw new ArgumentException("Dive Depth must not be or negative.", nameof(newdive_depth));
     }
     Dive_Number     = newdive_number;
     p_Dive_Location = newdive_location;
     p_Dive_Depth    = newdive_depth;
     Dive_Type       = newdive_type;
     Console.WriteLine("Update_Dive called\n");
 }