Exemple #1
0
 public LoginPage()
 {
     InitializeComponent();
        // server = new Server();
     server = SerLoad();
     loginAdmin = new LoginManager(server);
 }
Exemple #2
0
 public AddTaskPage(Server server, int eventId)
 {
     InitializeComponent();
     isConfirm = false;
     this.server = server;
     this.eventId = eventId;
 }
Exemple #3
0
        public LoginManager(Server server)
        {
            // FUNCTION: intialise the class
            // PRE-CONDITIONS:
            // POST-CONDITIONS:

            this.server = server;
        }
 public AdminPage(Server server)
 {
     InitializeComponent();
     this.server = server;
     adminManager = new AdminManager(server);
     adminManager.GetStudentList(adminListView);
     toolStripStatusLabel1.Text = "Welcome to the Administrator Page.";
 }
Exemple #5
0
 public AddStudentPage(Server server, int eventId, bool isOverall)
 {
     InitializeComponent();
     isConfirm = false;
     eventsOrganizerSearchManager = new EventsOrganizerSearchManager(server);
     this.eventId = eventId;
     this.isOverall = isOverall;
     matricTextBox.Focus();
 }
Exemple #6
0
 public EditManpowerPage(Server server, int eventID, string matric)
 {
     InitializeComponent();
     eventManpowerManager = new EventManpowerManager(server);
     this.server = server;
     this.matric = matric;
     this.eventID = eventID;
     eventManpowerManager.GetOrganiserList(organiserListView, eventID);
     eventManpowerManager.GetFacilitatorList(facilitatorListView, eventID);
     eventManpowerManager.GetParticipantList(participantListView, eventID);
 }
Exemple #7
0
 public void AddEvents(Server server, int id, int role)
 {
     // FUNCTION: add event with particular Id
     // PRE-CONDITIONS: assuming id exist
     // POST-CONDITIONS:
     eventsList.Add(id, role);
     Event events = server.GetEvent(id);
     if (role == 1) events.AddOrganiser(matric,false);
     else if (role == 2) events.AddFacilitator(matric,false);
     else events.AddParticipant(matric,false);
 }
Exemple #8
0
        public void DeleteEvents(Server server, int id)
        {
            // FUNCTION: delete event with particular Id
            // PRE-CONDITIONS: assuming id exist
            // POST-CONDITIONS:
            Event events = server.GetEvent(id);
            if (eventsList[id] == 1) events.DeleteOrganiser(matric,server);
            else if (eventsList[id] == 2) events.DeleteFacilitator(matric);
            else events.DeleteParticipant(matric);

            eventsList.Remove(id);
        }
Exemple #9
0
 public void DeleteEvents(Server server)
 {
     // FUNCTION: delete all event the student have, for deleting the student
     // PRE-CONDITIONS: assuming id exist
     // POST-CONDITIONS:
     Event events;
     foreach (KeyValuePair<int, int> kvp in eventsList) {
         events = server.GetEvent(kvp.Key);
         if (kvp.Value == 1) events.DeleteOrganiser(matric,server);
         else if (kvp.Value == 2) events.DeleteFacilitator(matric);
         else events.DeleteParticipant(matric);
     }
 }
Exemple #10
0
 public AddTaskPage(string name, string matric, string inChargeName, DateTime deadline, string description, Server server, int eventId)
 {
     InitializeComponent();
     isConfirm = false;
     this.matric = matric;
     this.inChargeName = inChargeName;
     this.server = server;
     this.eventId = eventId;
     nameTextBox.Text = name;
     descriptionTextBox.Text = description;
     inChargeTextBox.Text = inChargeName;
     deadlineBox.Value = deadline;
     this.Text = "Edit Task";
 }
Exemple #11
0
        public DashBoardPage(string matric, Server server)
        {
            InitializeComponent();
            this.server = server;
            this.matric = matric;
            studentEventManager = new StudentEventManager(server);

            this.nameLabel.Text = studentEventManager.GetName(matric);
            this.matricLabel.Text = matric;

            dateManager = new DateTimeManager();
            DateTime today = DateTime.Today;
            this.dateLabel.Text = today.ToString("d") + " |";
            this.weekLabel.Text = dateManager.CurrentAcademicWeek();
            this.academicYearSemLabel.Text = dateManager.CurrentAcademicYear();

            studentEventManager.GetStudentEventsTasks(this.myEventListView, this.myTaskListView, matric);
            studentEventManager.GetEvents(this.eventListView);
        }
        public EventControllerPage(Server server, int eventId, string matric)
        {
            InitializeComponent();
            this.server = server;
            this.eventId = eventId;
            this.matric = matric;
            eventOrganizerManager = new EventOrganizerManager(server);
            this.publishCheckBox.Checked = server.GetEvent(eventId).published;

            //overall
            this.campNameLabel.Text = eventOrganizerManager.GetEventName(eventId);
            this.startDateLabel.Text = eventOrganizerManager.GetEventStartDate(eventId);
            this.endDateLabel.Text = eventOrganizerManager.GetEventEndDate(eventId);
            this.organizersNoLabel.Text = eventOrganizerManager.GetManpowerCount(eventId, 1).ToString();
            this.facilitatorsNoLabel.Text = eventOrganizerManager.GetManpowerCount(eventId, 2).ToString();
            this.participantsNoLabel.Text = eventOrganizerManager.GetManpowerCount(eventId, 3).ToString();
            this.descriptionLabel.Text = eventOrganizerManager.GetEventDescription(eventId);

            //Program Tab
            this.programDateLabel.Text = this.startDateLabel.Text;
            if (this.startDateLabel.Text == this.endDateLabel.Text) {
                nextDayButton.Enabled = false;
            }

            eventOrganizerManager.GetProgramList(programListView, Convert.ToDateTime(this.startDateLabel.Text), this.eventId);

            //budget Tab
            this.totalIncomeLabel.Text = eventOrganizerManager.GetTotalIncome(eventId);
            this.totalExpenditureLabel.Text = eventOrganizerManager.GetTotalExpenditure(eventId);
            this.netCashflowLabel.Text = eventOrganizerManager.GetNetBudget(eventId);

            eventOrganizerManager.GetIncomeList(incomeListView, eventId);
            eventOrganizerManager.GetExpenditureList(expenditureListView, eventId);

            //logistic Tab
            eventOrganizerManager.GetLogsisticList(logisticListView, eventId);

            //Task Tab
            eventOrganizerManager.GetTaskList(taskListView, eventId);
            toolStripStatusLabel1.Text = "Welcome to the Event Manager for event <" + campNameLabel.Text + ">.";
        }
 public EventDetailsManager(Server server)
 {
     this.server = server;
 }
 public StudentEventManager(Server server)
 {
     this.server = server;
 }
Exemple #15
0
 public void DeleteOrganiser(string organizer, Server server)
 {
     // FUNCTION: delete for the organizer to be returned
     // PRE-CONDITIONS: organizer id must be valid
     // POST-CONDITIONS: if no more Organiser left delete the whole event
     organizerList.Remove(organizer);
     if (organizerList.Count == 0) {
         foreach (KeyValuePair<string, bool> kvp in facilitatorList) {
             server.GetStudent(kvp.Key).DeleteEvents(server, eventId);
         }
         foreach (KeyValuePair<string, bool> kvp in participantList) {
             server.GetStudent(kvp.Key).DeleteEvents(server, eventId);
         }
         server.DeleteEvent(eventId);
     }
 }
Exemple #16
0
 private void SerSave(Server temp)
 {
     // FUNCTION: Save the server class
     // PRE-CONDITIONS:
     // POST-CONDITIONS:
     using (Stream output = File.Create("Data.dat")) {
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(output, temp);
     }
 }
 public EventProgramManager(Server server)
 {
     this.server = server;
 }
Exemple #18
0
 public AdminManager(Server server)
 {
     this.server = server;
 }
Exemple #19
0
 public void GetEventTaskList(ListView eventListview, ListView taskListview, Server server)
 {
     ListViewItem lvi;
     foreach (KeyValuePair<int, int> kvp in eventsList) {
         if (kvp.Value == 1) {
             lvi = new ListViewItem(new[] { server.GetEvent(kvp.Key).name, "Organiser", Convert.ToString(kvp.Key) });
             Event events = server.GetEvent(Convert.ToInt32(lvi.SubItems[2].Text));
             events.GetTask(taskListview, matric);
         } else if (kvp.Value == 2) {
             lvi = new ListViewItem(new[] { server.GetEvent(kvp.Key).name, "Facilitator", Convert.ToString(kvp.Key) });
             Event events = server.GetEvent(Convert.ToInt32(lvi.SubItems[2].Text));
             events.GetTask(taskListview, matric);
         } else {
             lvi = new ListViewItem(new[] { server.GetEvent(kvp.Key).name, "Participant", Convert.ToString(kvp.Key) });
         }
         eventListview.Items.Add(lvi);
     }
 }
Exemple #20
0
 public void GetParticipantList(ListView participantListView, Server server)
 {
     ListViewItem lvi;
     Student student;
     foreach (KeyValuePair<string, bool> kvp in participantList) {
         student = server.GetStudent(kvp.Key);
         lvi = new ListViewItem(new[] { student.name, kvp.Key, kvp.Value ? "Yes" : "No" });
         participantListView.Items.Add(lvi);
     }
 }
Exemple #21
0
 public void GetTask(ListView taskListview,Server server)
 {
     ListViewItem lvi;
     foreach (Task task in taskList) {
         lvi = new ListViewItem(new[] { task.name, task.deadline.ToString("d"), task.inCharge, server.GetStudent(task.inCharge).name, task.description, task.programId == 0 ? "Overall" : EditProgram(task.programId).name, Convert.ToString(task.programId), Convert.ToString(task.taskId) });
         taskListview.Items.Add(lvi);
     }
 }
 public StudentParticularsManager(Server server)
 {
     this.server = server;
 }
 public EventOrganizerManager(Server server)
 {
     this.server = server;
 }
 public EventManpowerManager(Server server)
 {
     this.server = server;
 }
 public EventsOrganizerSearchManager(Server server)
 {
     this.server = server;
 }