//edit or view trainee profile private void Edit_View_trainee_Click(object sender, EventArgs e) { display_panel(null); if (Trainee_combobox.SelectedItem == null) { display_panel(Trainee_panel); MessageBox.Show("You must select trainer to be able to Edit or view"); return; } traineeobj = new Trainee((int)Trainee_combobox.SelectedValue); //display trainee profile Panel trainee_profile = traineeobj.show_edit_profile((int)Trainee_combobox.SelectedValue, id); this.Controls.Add(trainee_profile); trainee_profile.BringToFront(); trainee_profile.Visible = true; index1 = this.Controls.IndexOf(trainee_profile); }
private void bunifuThinButton21_Click(object sender, EventArgs e) { //log in button int id = -1; try { id = ControllerObj.CheckPassword(Convert.ToInt32(Idtextbox.Text), PassTextbox.Text); } catch (Exception) {} if (id >= 0) { if (id < 2000000) { this.Hide(); var form2 = new Management(id); form2.Closed += (s, args) => this.Close(); form2.Show(); } else if (id >= 3000000) { this.Hide(); var form2 = new Trainee(id); form2.Closed += (s, args) => this.Close(); form2.Show(); } ///TODO : Hager -> uncomment this after creating trainer form else { this.Hide(); var form2 = new trainer(id); form2.Closed += (s, args) => this.Close(); form2.Show(); } } else { MessageBox.Show("Wrong username or password"); } }