コード例 #1
0
 //  update number with name that are given
 public void PutEmergency(Emergency emergency)
 {
     if (!repository.Update(emergency))
     {
         throw new ArgumentNullException("Opps ! There is no Emergency with name #" + emergency.Name + " !");
     }
 }
コード例 #2
0
 public void Post(Emergency newEmergency)
 {
     if (newEmergency == null)
     {
         throw new ArgumentNullException("Opps ! Number object is null that was sended !");
     }
     emergencies.Add(newEmergency);
 }
コード例 #3
0
 public bool Update(Emergency updatedEmergency)
 {
     if (updatedEmergency == null  )
     {
         throw new ArgumentNullException("Opps ! Emergency object is null that was sended !");
     }
     else
     {
         var emergency = this.GetByName(updatedEmergency.Name);
         if (emergency.Name == "")
         {
             return false;
         }
         emergency.Number = updatedEmergency.Number;
         return true;
     }
 }
コード例 #4
0
 public void PostEmergency(Emergency newEmergency)
 {
     repository.Post(newEmergency);
 }