Beispiel #1
0
 public static bool UpdateTraveler(Traveler traveler)
 {
     try
     {
         using (YMprojectEntities1 entities = new YMprojectEntities1())
         {
             Traveler tt = entities.Travelers.First(t => t == traveler);
             tt = traveler;
             entities.SaveChanges();
         }
         return(true);
     }
     catch { return(false); }
 }
Beispiel #2
0
 public static bool DeleteTraveler(Traveler traveler)
 {
     try
     {
         using (YMprojectEntities1 entities = new YMprojectEntities1())
         {
             entities.Travelers.Remove(traveler);
             entities.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #3
0
 public static TravelerDto ToDTO(DAL.Traveler model)
 {
     if (model is null)
     {
         return(null);
     }
     return(new TravelerDto()
     {
         TravelerID = model.TravelerID,
         TravelerName = model.TravelerName,
         BirthDate = model.BirthDate,
         gender = model.gender,
         UserName = model.TravelerName,
         TravelerPassword = model.User.UserPassword
     });
 }