Exemple #1
0
        /// <summary>
        /// Creates a new boat and calls the database class to add it to the database.
        /// </summary>
        /// <param name="boatType">A BoatType enum.</param>
        /// <param name="length">The boat length.</param>
        public void AddBoat(BoatType boatType, double length)
        {
            Boat newBoat = new Boat()
            {
                Type   = boatType,
                Length = length,
                BoatId = GenerateId()
            };

            Database.AddBoat(newBoat, _ownerPersonalId).Wait();
        }
Exemple #2
0
 /// <summary>
 /// Updates a boat and calls the database class to add changes to the database.
 /// </summary>
 /// <param name="boatType">A BoatType enum.</param>
 /// <param name="length">The boat length.</param>
 public void UpdateBoat(int id, BoatType boatType, double length)
 {
     if (Database.BoatIdExist(id, _ownerPersonalId).Result)
     {
         Boat newBoat = new Boat()
         {
             Type   = boatType,
             Length = length,
             BoatId = id
         };
         Database.AddBoat(newBoat, _ownerPersonalId).Wait();
     }
 }