/// <summary> /// Opens the assign staff form. /// </summary> /// <param name="jobID"></param> /// <returns></returns> public bool OpenAssignStaff(int jobID) { try { // Creates new form, registers this presenter // and then opens the form as a dialogue to home. // Also grabs all the staff names. Once finished, // the home form updates its jobs. m_assignStaff = new AssignStaffToJob(jobID); m_assignStaff.RegisterPresenter(this); List <string> Names = new List <string>(); List <Staff> StaffMembers = m_databaseController.GetAllStaff(); foreach (var Staff in StaffMembers) { string ID = Staff.StaffID.ToString(); string Forname = Staff.Forename; string Surname = Staff.Surname; Names.Add($"{ID}: {Surname}, {Forname}"); } m_assignStaff.FillStaffNames(Names); m_assignStaff.OpenForm(m_home as Home); m_home.UpdateJobs(); } catch (Exception) { return(false); } return(true); }