Ejemplo n.º 1
0
 private void StoreAircraftPhoto(jafleetContext context, AircraftPhoto photo, string photoUrl, string reg, string directUrl)
 {
     if (photo != null)
     {
         photo.PhotoUrl       = photoUrl;
         photo.PhotoDirectUrl = directUrl;
         photo.LastAccess     = DateTime.Now;
         context.AircraftPhoto.Update(photo);
     }
     else
     {
         context.AircraftPhoto.Add(new AircraftPhoto {
             RegistrationNumber = reg, PhotoUrl = photoUrl, LastAccess = DateTime.Now
         });
     }
     context.SaveChanges();
 }
Ejemplo n.º 2
0
 public static AircraftPhoto MakePersistent(AircraftPhoto p)
 {
     NHibernateHelper.GetCurrentSession().SaveOrUpdate(p);
     return(p);
 }