ViewModel.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using PP_Ven_MosS.ModelBase;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data.Entity;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PP_Ven_MosS.Classes
  9. {
  10. public class Users
  11. {
  12. public List<User> usr;
  13. public Users()
  14. {
  15. usr = newuser();
  16. }
  17. public List<User> newuser()
  18. {
  19. List<User> users = new List<User>();
  20. User buff;
  21. List<User> bdusers = Database.entities.User.ToList();
  22. foreach (User user in bdusers)
  23. {
  24. buff = new User();
  25. buff.Id_user = user.Id_user;
  26. buff.Surname = user.Surname;
  27. buff.Name = user.Name;
  28. buff.Patronymic = user.Patronymic;
  29. buff.Post = user.Post;
  30. buff.Phone_number = user.Phone_number;
  31. buff.Login = user.Login;
  32. buff.Password = user.Password;
  33. users.Add(buff);
  34. }
  35. return users;
  36. }
  37. }
  38. }