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); } }
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); } }
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 }); }