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

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