public void sayHelloToUser(IEmployeeEntryForm form) { form.setHelloLabel(ActiveUser.Name + " " + ActiveUser.Surname); }
public void removeUserFromTrip(IEmployeeEntryForm form) { int id = form.getSelectedPartTripID(); Trip t = TripRepository.GetInstance().getTripByID(id); t.removeTraveller(ActiveUser); ActiveUser.removeParticipatedTrip(t); }
public void returnConfirmation(IEmployeeEntryForm form) { int id = form.getSelectedMyTripID(); Trip t = TripRepository.GetInstance().getTripByID(id); t.isDone = true; t.Vehicle.IsAvailable = true; }
public void displayTripDetails(IEmployeeEntryForm form) { int id = form.getSelectedMyTripID(); Trip t = TripRepository.GetInstance().getTripByID(id); form.setDisplayTripDetails("Stops:"); foreach (TripStops ts in t.Stops) { string s = ts.City.Name + "," + ts.City.Country; s += "(" + ts.TripDate.ToString() + ")"; form.setDisplayTripDetails(s); } form.setDisplayTripDetails("Travellers:"); foreach (Employee e in t.getTravellers()) { string s = e.Name + " " + e.Surname; form.setDisplayTripDetails(s); } form.setDisplayTripDetails("Cost:"); form.setDisplayTripDetails(t.TripCost.ToString() + " € "); }
public void openEmployeeEntryForm(IEmployeeEntryForm form) { form.showForm(); }
public void displayPartTrips(IEmployeeEntryForm form) { foreach (Trip t in ActiveUser.ParticipatedTripList) { string id = t.ID.ToString(); string from = t.DepartureCity.Name + "," + t.DepartureCity.Country; string to = t.DestinationCity.Name + "," + t.DestinationCity.Country; string date = t.departureDate.ToString(); string driver = t.TripOwner.Name + " " + t.TripOwner.Surname; form.setDisplayPartTrip(id, from, to, date, driver); } }
public void displayMyTrips(IEmployeeEntryForm form) { List<Trip> trips = new List<Trip>(); foreach(Trip t in TripRepository.GetInstance().getAcitveOnes()) { if (t.TripOwner == ActiveUser) { trips.Add(t); } } foreach (Trip t in trips) { string id = t.ID.ToString(); string from = t.DepartureCity.Name + "," + t.DepartureCity.Country; string to = t.DestinationCity.Name + "," + t.DestinationCity.Country; string date = t.departureDate.ToString(); string ap; if (t.IsAprooved == false) ap = "NO"; else ap = "YES"; form.setDisplayItem(id, from, to, date, ap); } }
public void displayContacts(IEmployeeEntryForm form) { int id = form.getSelectedPartTripID(); Trip t = TripRepository.GetInstance().getTripByID(id); Employee e = t.TripOwner; form.setDisplayContacts(e.Name + " " + e.Surname, e.ContactPhone, e.ContactEMail); foreach(Employee em in t.getTravellers()) { if(em!=ActiveUser && em != t.TripOwner) { form.setDisplayContacts(em.Name + " " + em.Surname, em.ContactPhone, em.ContactEMail); } } }
public void closeEmployeeEntryForm(IEmployeeEntryForm form) { form.closeForm(); }
public void cancelSelectedTrips(IEmployeeEntryForm form) { int id = form.getSelectedMyTripID(); Trip t = TripRepository.GetInstance().getTripByID(id); TripRepository.GetInstance().removeTrip(t); }