コード例 #1
0
 private void ShowList()
 {
     TableResultList.DataSource = (from p in model.UserSystems
                                   where p.UserDataId == user.Id
                                   select new
     {
         id = p.Id,
         Наименование = p.SystemCollection.SystemName
     }).ToList();
     TableResultList.Columns[TableResultList.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
     TableResultList.Update();
     TableResultList.Columns[0].Visible = false;
     TableResultList.ClearSelection();
 }
コード例 #2
0
 public void ShowList()
 {
     TableResultList.DataSource = (from u in model.UserDatas
                                   join us in model.UserSystems
                                   on u.Id equals us.UserDataId
                                   join s in model.SystemCollections
                                   on us.SystemCollectionId equals s.Id
                                   where u.RoleUser == "user"
                                   select new
     {
         id = us.Id,
         Пользователь = u.NameUser,
         Система = s.SystemName
     }).ToList();
     TableResultList.Columns[TableResultList.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
     TableResultList.Update();
     TableResultList.Columns[0].Visible = false;
     TableResultList.ClearSelection();
 }