Esempio n. 1
0
 public void sayHelloToUser(IEmployeeEntryForm form)
 {
     form.setHelloLabel(ActiveUser.Name + " " + ActiveUser.Surname);
 }
Esempio n. 2
0
 public void removeUserFromTrip(IEmployeeEntryForm form)
 {
     int id = form.getSelectedPartTripID();
     Trip t = TripRepository.GetInstance().getTripByID(id);
     t.removeTraveller(ActiveUser);
     ActiveUser.removeParticipatedTrip(t);
 }
Esempio n. 3
0
 public void returnConfirmation(IEmployeeEntryForm form)
 {
     int id = form.getSelectedMyTripID();
     Trip t = TripRepository.GetInstance().getTripByID(id);
     t.isDone = true;
     t.Vehicle.IsAvailable = true;
 }
Esempio n. 4
0
        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() + " € ");
        }
Esempio n. 5
0
 public void openEmployeeEntryForm(IEmployeeEntryForm form)
 {
     form.showForm();
 }
Esempio n. 6
0
        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);

            }
        }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 8
0
        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);
                }
            }
        }
Esempio n. 9
0
 public void closeEmployeeEntryForm(IEmployeeEntryForm form)
 {
     form.closeForm();
 }
Esempio n. 10
0
 public void cancelSelectedTrips(IEmployeeEntryForm form)
 {
     int id = form.getSelectedMyTripID();
     Trip t = TripRepository.GetInstance().getTripByID(id);
     TripRepository.GetInstance().removeTrip(t);
 }