123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Rkis29.ViewModel;
- using Rkis29.Windows;
- using Rkis29.Command;
- using System.Collections.ObjectModel;
- namespace Rkis29.Command
- {
- internal class YourProfileCod : BaseViewModel
- {
- private RelayCommand _totasks;
- private ObservableCollection<User> _users;
- private User _user;
- public string _YourFCs;
- private string _YourLogin;
- private string _YourPhon;
- public RelayCommand ToTasks
- {
- get
- {
- return _totasks ??
- (_totasks = new RelayCommand((x) =>
- {
- Tasks taskWindow = new Tasks();
- taskWindow.Show();
- foreach (var window in App.Current.Windows)
- {
- if (window is YourProfile mainWindow)
- {
- mainWindow.Close();
- }
- }
- }));
- }
- }
- public string YourFCs
- {
- get => _YourFCs = User.AutoUser.FirstName + " " + User.AutoUser.Name + " " + User.AutoUser.LastName;
- }
- public string YourLogin
- {
- get => _YourLogin = User.AutoUser.Login;//AutoUser - переменная, которая хранит значения авторизованного пользователя
- }
- public string YourPhon
- {
- get => _YourPhon = User.AutoUser.PhonNum;
- }
- public ObservableCollection<User> Users
- {
- get => _users;
- set
- {
- _users = value;
- OnPropertyChanged();
- }
- }
- public User User
- {
- get => _user;
- set
- {
- _user = value;
- OnPropertyChanged();
- }
- }
- public YourProfileCod()
- {
- loferlContext loferlcontext = new loferlContext();
- _users = new ObservableCollection<User>(loferlcontext.Users);
- _user = new User();
- }
- }
- }
|