// Saves when the form closes private void employeeAdd_FormClosed(object sender, FormClosedEventArgs e) { Form1.currentStaff = original; SaveToFile.serializeAll(); if (action == 1 && Form1.currentStaff.Count > 0) { employeeSelect eS = new employeeSelect(); eS.ShowDialog(); } }
// Opens up change employee winform private void changeEmployeeButton_Click(object sender, EventArgs e) { // If there's any staff if (Form1.currentStaff.Count > 0) { employeeSelect eS = new employeeSelect(); eS.ShowDialog(); } else { employeeAdd aE = new employeeAdd(1); aE.ShowDialog(); } // Display what employee is logged in this.Text = currentEmployee + ": " + versionNumber; Refresh(); }
// "Contructor" public Form1() { InitializeComponent(); //new SplashScreen(); instrumentList.DataSource = allInstruments; newDataDisplay.Text = ""; setFilepath(); instrumentList.Select(); // Sort instruments into their respective lists sortInstruments(); searchBox.Select(); // Select employee if (currentStaff.Count != 0) { employeeSelect eS = new employeeSelect(); eS.ShowDialog(); } this.Text = currentEmployee + ": " + versionNumber; }