public WindowSongViewerController(WindowOwnerMenuController parentView) { userCollection = new UserCollection(); windowSongViewer = new WindowSongViewer(this); this.parent = parentView; windowSongViewer.SearchSongByNameDataGrid.DataSource = userCollection.Songs; }
public void Login() { // Haal ingevoerde waardes op. string username = windowLogin.textBoxUsername.Text; string password = windowLogin.textBoxPassword.Text; // Toon error als velden leeg zijn (of als de standaardwaardes ingevuld zijn). if (username == "" || password == "") { windowLogin.labelError.Text = "Één of meer velden zijn leeg!"; return; } // Verifiëer login informatie if (EncryptionHelper.VerifyLogin(username, password)) { // Sla ingelogde gebruiker op LoggedInUser = GetUserByUsername(username); // leeg de tekstboxen windowLogin.labelError.Text = ""; windowLogin.textBoxUsername.Text = ""; windowLogin.textBoxPassword.Text = ""; // Als User.IsOwner == true dan is de gebruiker een eigenaar en moet het eigenaarscherm gestart worden. if (GetIsOwnerByUsername(username)) { // start het eigenaar scherm WindowOwnerMenuController woc = new WindowOwnerMenuController(this); woc.Show(); } // Als de gebruiker een student is (User.IsOwner == false) dan moet het pianoscherm gestart worden. else { // Start het pianoscherm WindowStudentController wl = new WindowStudentController(this); //controller laten bestaan enzo anders krijg je nullpointers wl.Show(); } // Verberg het login scherm this.Hide(); } else { windowLogin.labelError.Text = "Gebruikersnaam en/of wachtwoord incorrect!"; } }
public WindowStudentViewerController(WindowOwnerMenuController parentView) { userCollection = new UserCollection(); windowOwner = new WindowStudentViewer(this); this.parent = parentView; windowOwner.SearchStudentByNameDataGrid.DataSource = userCollection.Students; // Toevoegen grafiek veld. windowOwner.chartStudentProgress.Series.Add("Voortgang"); // Grafiek properties aanpassen. windowOwner.chartStudentProgress.Series[0].IsValueShownAsLabel = true; windowOwner.chartStudentProgress.Series[0].LabelFormat = "P"; windowOwner.chartStudentProgress.Series[0].MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle; windowOwner.chartStudentProgress.Series[0].MarkerSize = 7; windowOwner.chartStudentProgress.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; windowOwner.chartStudentProgress.Series[0].LabelBackColor = System.Drawing.Color.FromArgb(240, 240, 240); windowOwner.chartStudentProgress.ChartAreas[0].AxisY.Maximum = 1; windowOwner.chartStudentProgress.ChartAreas[0].AxisY.Minimum = 0; windowOwner.chartStudentProgress.ChartAreas[0].AxisY.LabelStyle.Format = "P"; }