//private List<User> users;
 public UsersUC(AdminMenu adminMenu, int id)
 {
     InitializeComponent();
     ad      = adminMenu;
     adminId = id;
     // st = receivedWindow;
     //users = new List<User>();
     using (var db = new LibraryDBEntities())
     {
         //users = db.Users.ToList();
         var users = from u in db.Users
                     select new
         {
             Id       = u.Id,
             FName    = u.FName,
             LName    = u.LName,
             Login    = u.Login,
             Password = u.Password,
             Email    = u.Email,
             Role     = u.Role.Name
         };
         Users.ItemsSource = users.ToList();
     }
 }
Пример #2
0
        public AddBookUC(AdminMenu adminMenu, int id)
        {
            InitializeComponent();
            ad      = adminMenu;
            adminId = id;

            using (var db = new LibraryDBEntities())
            {
                var genres = from g in db.Genres
                             select new
                {
                    Id   = g.Id,
                    Name = g.Name
                };

                GenresList.ItemsSource = genres.ToList();

                var themes = from g in db.Themes
                             select new
                {
                    Id   = g.Id,
                    Name = g.Name
                };

                ThemesList.ItemsSource = themes.ToList();

                var locations = from g in db.Locations
                                select new
                {
                    Id   = g.Id,
                    Name = g.Name
                };

                LocationList.ItemsSource = locations.ToList();
            }
        }
 public AddUseUC(AdminMenu adminmenu, int id)
 {
     InitializeComponent();
     ad      = adminmenu;
     adminId = id;
 }
Пример #4
0
 public AuthorsUC(AdminMenu received)
 {
     InitializeComponent();
     ad = received;
 }