예제 #1
0
파일: Point.cs 프로젝트: Olliiee/yapbt
 /// <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;
     }
 }
예제 #2
0
파일: Point.cs 프로젝트: Olliiee/yapbt
        /// <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;
            }
        }