public UserEmployerGrades() { InitializeComponent(); studentIdList = new List <int>(); DeleteGradeEnabled = EmployerSession.IsPrincipal(); AddStudentEnabled = EmployerSession.IsPrincipal(); string commandText = "USE SchoolBase SELECT [Идентификатор], [Имя учащегося], [Фамилия учащегося] FROM dbo.SchoolStudents"; if (EmployerSession.GetClassNumber() != "") { commandText += " WHERE [Класс] = '" + EmployerSession.GetClassNumber() + "'"; } SqlConnection connection = new SqlConnection("Server=localhost\\SQLEXPRESS;Database=master;Trusted_Connection=True;"); SqlCommand command = new SqlCommand(commandText, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { studentIdList.Add(reader.GetInt32(0)); ListStudents.Items.Add(reader.GetInt32(0) + " | " + reader.GetString(1) + " | " + reader.GetString(2)); } connection.Close(); }
private void DeleteGradeClick(object sender, RoutedEventArgs e) { if (EmployerSession.IsPrincipal()) { int index = ListStudents.SelectedIndex; if (index != -1) { ((Border)Parent).Child = new UserEmployerGradesOperator(studentIdList[index]); } } }
public UserEmployerSchedule() { InitializeComponent(); ScheduleListMonday = new List <string>(); ScheduleListTuesday = new List <string>(); ScheduleListWednesday = new List <string>(); ScheduleListThursday = new List <string>(); ScheduleListFriday = new List <string>(); ScheduleListSaturday = new List <string>(); IsEnabledScheduleOperator = EmployerSession.IsPrincipal(); GridScheduleOperatorVisibility = Visibility.Hidden; BorderClasses.Visibility = EmployerSession.IsPrincipal() ? Visibility.Visible : Visibility.Hidden; BoxClasses.Items.Add("Выберите класс"); BoxLessons.Items.Add("Выберите предмет"); BoxClasses.SelectedIndex = 0; BoxLessons.SelectedIndex = 0; XmlDocument doc = new XmlDocument(); doc.Load("E://Univers//Other//Work//C#//SomeFiles//1//WpfAppSchool//Lessons.xml"); XmlElement xe = doc.DocumentElement; foreach (XmlNode node in xe.ChildNodes) { string ns = node.InnerText.Trim(new char[] { '\r', '\n', ' ' }); BoxLessons.Items.Add(ns); } doc.Load("E://Univers//Other//Work//C#//SomeFiles//1//WpfAppSchool//ClassNumbers.xml"); xe = doc.DocumentElement; foreach (XmlNode node in xe.ChildNodes) { string ns = node.InnerText.Trim(new char[] { '\r', '\n', ' ' }); BoxClasses.Items.Add(ns); } }
private void ActivateScheduler(object sender, RoutedEventArgs e) { GridScheduleOperatorVisibility = EmployerSession.IsPrincipal() ? Visibility.Visible : Visibility.Hidden; }
private void AddStudentClick(object sender, RoutedEventArgs e) { if (EmployerSession.IsPrincipal()) { } }
public UserEmployerMainMenu() { InitializeComponent(); IsEnabledRegulator = EmployerSession.IsPrincipal(); }