private void buttonLogin_Click(object sender, EventArgs e) { MainScreen mainForm = new MainScreen(); if (!String.IsNullOrEmpty(textBoxUsername.Text) && !String.IsNullOrEmpty(textBoxPassword.Text)) { userType = Database.Login(textBoxUsername.Text, textBoxPassword.Text); //Try to login, if it successed the user's type is returned if (userType == UserTypes.STUDENT) { activeUser = StudentMapper.Get(textBoxUsername.Text).Username; this.Hide(); mainForm.Show(); } else if (userType == UserTypes.PROFESSOR) { activeUser = ProfessorMapper.Get(textBoxUsername.Text).Username; this.Hide(); mainForm.Show(); } else { MessageBox.Show("Δεν βρέθηκε ο χρήστης! Για να δημιουργήσετε ένα λογαριασμό παρακαλούμε πατήστε το κουμπί Εγγραφή!", "Ειδοποίηση", MessageBoxButtons.OK); } } else { MessageBox.Show("Παρακαλούμε εισάγετε ένα όνομα χρήστη!", "Ειδοποίηση", MessageBoxButtons.OK); } }
public List <ProfessorDAO> GetProfessors() { var p = new List <ProfessorDAO>(); foreach (var professors in ef.GetProfessors()) { p.Add(ProfessorMapper.MapToProfessorDAO(professors)); } return(p); }
public AutoMapperProfile() { UsuarioMapper.Map(this); CargoMapper.Map(this); DisciplinaMapper.Map(this); ProfessorMapper.Map(this); EscolaridadeMapper.Map(this); ModalidadeEnsinoMapper.Map(this); ContratoAulaMapper.Map(this); AvaliacaoProfessorMapper.Map(this); }
private void MainScreen_Load(object sender, EventArgs e) { panelBlank.Visible = false; panelMult.Visible = false; panelTF.Visible = false; buttonList.Add(button1); buttonList.Add(button2); buttonList.Add(button3); buttonList.Add(button4); buttonList.Add(button5); buttonList.Add(button6); buttonList.Add(button7); buttonList.Add(button8); buttonList.Add(button9); buttonList.Add(button10); buttonList.Add(buttonFinalExam); questionPanelList.Add(panelBlank); questionPanelList.Add(panelMult); questionPanelList.Add(panelTF); if (LoginScreen.userType == "student") //User is a Student { activeStudent = StudentMapper.Get(LoginScreen.activeUser); if (activeStudent.Level < 12) //Update buttons based on quiz completion (Level) { for (int i = 0; i < activeStudent.Level; i++) { buttonList[i].Enabled = true; buttonList[i].Image = Resources.tick; toolTipMain.SetToolTip(buttonList[i], "Έχει ολοκληρωθεί η προπαίδεια του " + (i + 1).ToString()); } buttonList[activeStudent.Level - 1].Image = Resources.unlock; toolTipMain.SetToolTip(buttonList[activeStudent.Level - 1], "Διαβάστε την προπαίδεια και όταν είστε έτοιμοι δοκιμάστε το τεστ!"); buttonList[activeStudent.Level - 1].PerformClick(); } else //Update all buttons as complete { for (int i = 0; i <= 10; i++) { buttonList[i].Enabled = true; buttonList[i].Image = Resources.tick; toolTipMain.SetToolTip(buttonList[i], "Έχει ολοκληρωθεί η προπαίδεια του " + (i + 1).ToString()); } buttonList[10].PerformClick(); } pictureBoxGrades.Visible = true; studentGrades.Add(labelGradeShow1); studentGrades.Add(labelGradeShow2); studentGrades.Add(labelGradeShow3); studentGrades.Add(labelGradeShow4); studentGrades.Add(labelGradeShow5); studentGrades.Add(labelGradeShow6); studentGrades.Add(labelGradeShow7); studentGrades.Add(labelGradeShow8); studentGrades.Add(labelGradeShow9); studentGrades.Add(labelGradeShow10); studentGrades.Add(labelGradeShowFinal); } else //User is a professor { activeProfessor = ProfessorMapper.Get(LoginScreen.activeUser); for (int i = 0; i < 11; i++) { buttonList[i].Visible = false; } buttonSave.Visible = true; panelProf.Visible = true; buttonTakeQuiz.Visible = false; pictureBoxSettings.Enabled = false; labelTitle.Text = "Διαχείριση Μαθητών"; labelTitleNumber.Visible = false; gradesList.Add(numericUpDown1); gradesList.Add(numericUpDown2); gradesList.Add(numericUpDown3); gradesList.Add(numericUpDown4); gradesList.Add(numericUpDown5); gradesList.Add(numericUpDown6); gradesList.Add(numericUpDown7); gradesList.Add(numericUpDown8); gradesList.Add(numericUpDown9); gradesList.Add(numericUpDown10); gradesList.Add(numericUpDownFinal); } }