/// <summary> /// Add a single point to the db. /// </summary> /// <param name="pointToAdd">The point object.</param> /// <returns>True everything ok; False something went wrong.</returns> public bool AddPoint(AirportPushPoints pointToAdd) { try { using (var db = new YapbtDbEntities()) { db.AirportPushPoints.Add(pointToAdd); return true; } } catch (Exception) { return false; } }
/// <summary> /// Remove a single pushback point. /// </summary> /// <param name="pushBackPoint">The single pushback point we are looking for.</param> /// <returns>True point deleted; False something went wrong.</returns> public bool RemovePushbackPoint(AirportPushPoints pushBackPoint) { try { // Checking if the point is set. if (pushBackPoint != null) { using (var db = new YapbtDbEntities()) { // Remove the pushback point. db.AirportPushPoints.Remove(pushBackPoint); db.SaveChanges(); return true; } } return false; } catch (Exception) { return false; throw; } }