Пример #1
0
 public bool AddPotential(Potential p)
 {
     try
     {
         dataStore.AddPotential(p);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 // This function will attempt to add a potential to the database.
 public bool AddPotential(Potential p)
 {
     // This will attempt to add the referenced
     // Potential to the database. Throw an exception
     // If it is unsccessful.
     try
     {
         dataStore.AddPotential(p);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine("Unable to add a potential to the database.");
         Console.WriteLine("Exception Message: " + e.Message);
         return(false);
     }
 }