private void LoginClick(object sender, RoutedEventArgs e) { if (m.validate(input_id.Text, input_pass.Text)) { switch ((m.getUserRank(input_id.Text)).ElementAt(0).rank) { case 0: //admin AdminScreen asc = new AdminScreen(m); asc.Show(); this.Hide(); break; case 1: //doctor DoctorScreen ds = new DoctorScreen(m, input_id.Text); BackEndLayer.Doctor [] tDoc = (m.SearchDoctorByID(input_id.Text)).ToArray(); if (tDoc.Length > 0) { ds.data_doctor.Content = "Dr. " + tDoc[0].getName(); } ds.Show(); this.Hide(); break; case 2: //patient PatientScreen ps = new PatientScreen(m); ps.Show(); this.Hide(); break; } } else { MessageBoxResult err = MessageBox.Show("Wrong username or password"); } }
private void LoginClick(object sender, RoutedEventArgs e) { if (m.validate(input_id.Text, input_pass.Text)) { DoctorScreen ds = new DoctorScreen(m); ds.Show(); ds.textBox1.Text = "sasa"; this.Hide(); } else { MessageBoxResult err = MessageBox.Show("Wrong username or password"); } }