public FormViewCoursesUser(int id, string lastname, string firstname, string middlename, string user) { InitializeComponent(); User = user; Id = id; LblUserId.Content = Id; Lastname = lastname; LblUsername.Content = String.Format($"{lastname} {firstname} {middlename}"); DataGridUserCourses.ItemsSource = courseRepository.GetCoursesByUserId(Id); string rating = courseRepository.AllRating(Id); if (rating == String.Empty) { TxbxAllRating.Text = "Баллы отсутствуют"; TxbxAllRating.FontSize = 12; } else { TxbxAllRating.Text = rating; } }
private void CbxUsersSummaryStatement_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { try { if (CbxUsersSummaryStatement.SelectedIndex != -1) { String usernameFio = CbxUsersSummaryStatement.SelectedItem.ToString(); String[] words = usernameFio.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); DataGridSummaryStatement.ItemsSource = courseRepository.GetSummaryStatementByFio(words[0], words[1], words[2]); otherRepository.SettingDataGridSummaryStatement(DataGridSummaryStatement); int userId = userRepository.GetUserIdByFio(words[0], words[1], words[2]); LblSummary.Content = courseRepository.AllRating(userId); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public MainWindow(Users user) { InitializeComponent(); DataGridMain.ItemsSource = courseRepository.GetCoursesByUserId(user.Id); TxbxAllRating.Text = courseRepository.AllRating(user.Id); CbxMainShowCategory.SelectedIndex = -1; TxbxUserId.Text = user.Id.ToString(); TxbxUserLastname.Text = user.Lastname; TxbxUserFirstname.Text = user.Firstname; TxbxUserMiddlename.Text = user.Middlename; TxbxUserPosition.Text = user.Position; Email = user.Email; }