public MainViewModel() { UpdateViewCommand = new UpdateViewCommand(this); //UpdateViewCommand.Execute("Login"); CheckLoggin(); }
private void Receive(int cmd, string data) { if (cmd == (int)ResponseInfo.False) { MessageBox.Show("다시 확인 바랍니다."); } else if (cmd == (int)ResponseInfo.Already) { MessageBox.Show("다른 곳에서 접속 중입니다. 연결을 끊고 시도해 주세요."); } else if (cmd == (int)ResponseInfo.Auth) { MessageBox.Show("인증받지 않은 아이디입니다. 이메일 인증을 진행해 주세요."); Detach(); UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand; update.Execute("Auth"); } else { Detach(); UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand; update.Execute("Home"); } }
public void GoJoin() { Detach(); UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand; update.Execute("Join"); }
public MainWindow() { InitializeComponent(); MainView = new MainViewModel(); ICommand UpdateViewCommand = new UpdateViewCommand(MainView); DataContext = MainView; UpdateViewCommand.Execute("Login"); }
public MainViewModel(StorageSerializer storageSerializer) { var storage = storageSerializer.Load(); var seriesCollection = storage.SeriesCollection ?? new ObservableCollection <Series>(); var counter = new Counter(storage.Id ?? 0); var updateViewCommand = new UpdateViewCommand(this, storageSerializer, counter, seriesCollection); var content = new EntryListViewModel(seriesCollection); CurrentViewModel = new ShowEntryListViewModel(content, updateViewCommand); }
public ActualMainVM() { //UserHandler.Instance.Load(); Login = new RelayCommand((o) => { bool check = false; MD5 hash = MD5.Create(); var schluessel1 = hash.ComputeHash(Encoding.UTF8.GetBytes(Password)); Password = Convert.ToBase64String(schluessel1); SqlConnection con = new SqlConnection(VERBINDUNG); string sql = $"Select UserName, UserPassword from documentFilingPassword where UserName = '******' and UserPassword = '******'"; con.Open(); SqlCommand com = new SqlCommand(sql, con); SqlDataReader reader = com.ExecuteReader(); while (reader.Read()) { check = true; } reader.Close(); com.Dispose(); con.Close(); if (check) { Window start = new DocumentFilingView(); start.ShowDialog(); } else { ErrorLogin = "******"; } //if (UserHandler.Instance.GetUsers().Find(u => u.UserName == UserName && u.Password == Password) != null) //{ // Window start = new DocumentFilingView(); // start.ShowDialog(); //} //else //{ // ErrorLogin = "******"; //} }); UpdatePage = new UpdateViewCommand(this); }
public UserPageViewModel(MainWindowViewModel mainWindowViewModel) { _mainWindowViewModel = mainWindowViewModel; UpdateViewToEditNoteViewCommand = new UpdateViewToEditNoteViewCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); LogoutCommand = new LogoutCommand(mainWindowViewModel); UserNotesList = new myBindingList <Note>(); UserNotesList.BeforeRemove += UserNotesList_BeforeRemove; }
public BalanceViewModel() { SingleCurrentAccount currentAccount = SingleCurrentAccount.GetInstance(); CurrentAccount = currentAccount.Account; UnitOfWork = new UnitOfWork(); Histories = new List <History>(); GetHistories(); CreateCommand.CheckRepeatHistories(); Balance = GetBalance(Histories); UpdateViewCommand = new UpdateViewCommand(MainWindow.MainView); RefreshHistoryCollectionView(); DeleteCommand = new DeleteCommand(this); LinkToEditCommand = new LinkToEditCommand(); }
private void Register() { try { using (UnitOfWork unit = new UnitOfWork()) { IEnumerable <User> result = unit.UserRepository.Get(x => x.UserLogin == UserLogin); if (result.Count() != 0) { Message = "Пользователь с таким логином уже существует!"; return; } else { User regUser = new User(); regUser.Salt = PasswordHash.GenerateSaltForPassword().ToString(); regUser.UserPassword = PasswordHash.ComputePasswordHash(UserPassword, int.Parse(regUser.Salt)); regUser.UserLogin = UserLogin; unit.UserRepository.Create(regUser); unit.Save(); User foundUser = unit.UserRepository.Get(x => x.UserLogin == regUser.UserLogin).First(); usersDatum.IdData = foundUser.Id; usersDatum.FullName = UserSurname + " " + UserName + " " + UserLastname; unit.UserDatumRepository.Create(usersDatum); unit.Save(); usersParam.IdParams = foundUser.Id; unit.UserParamRepository.Create(usersParam); unit.Save(); Message = "Регистрация прошла успешно! Введите логин и пароль"; UpdateViewCommand.Execute("LogInPage"); } } } catch (Exception exception) { MessageBox.Show("Сообщение ошибки: " + exception.Message, "Произошла ошибка"); } }
public NavigationViewModel(IDialogService dialogService, IWindowService windowService, IBrowserService browserService) { this.User = new UserRepo().LoginFirst(); UpdateViewCommand = new UpdateViewCommand(this, WorkStatus, User, dialogService, windowService, browserService); UpdateViewCommand.Execute(ViewType.Home); this.Title = User.Username; Sections = new ObservableCollection <string>(); // Initialize commands GetSectionsCommand = new RelayCommand(GetSections); // Change configuration connection string to writable var fi = typeof(ConfigurationElement).GetField("_bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic); fi.SetValue(ConfigurationManager.ConnectionStrings["Default"], false); // Populate sections GetSectionsCommand.Execute(null); }
private void Receive(int cmd, string data) { if (cmd == (int)ResponseInfo.True) { MessageBox.Show("인증이 완료되었습니다. 정상적인 이용이 가능합니다."); Detach(); UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand; update.Execute("Login"); } else if (cmd == (int)ResponseInfo.Ready) { MessageBox.Show("인증번호가 전송되었습니다. 인증을 진행해 주세요."); } else { MessageBox.Show("잘못된 번호입니다. 다시 한번 확인해 주세요."); } }
private void Receive(int cmd, string data) { if (cmd == (int)ResponseInfo.Email) { MessageBox.Show("이미 존재하는 계정입니다."); } else if (cmd == (int)ResponseInfo.Nickname) { MessageBox.Show("이미 존재하는 닉네임입니다."); } else { MessageBox.Show("가입 완료! 인증을 완료하셔야 이용 가능합니다."); Detach(); UpdateViewCommand update = MainViewModel.GetInstance().updateViewCommand as UpdateViewCommand; update.Execute("Auth"); } }
private async void OnKeyDownHandler(object sender, KeyEventArgs e) { if (e.Key == Key.Up && available) { available = false; data.gamePlay.playerMove(-1, 0); await Task.Delay(6000); available = true; } else if (e.Key == Key.Left && available) { available = false; data.gamePlay.playerMove(0, -1); await Task.Delay(6000); available = true; } else if (e.Key == Key.Down && available) { available = false; data.gamePlay.playerMove(1, 0); await Task.Delay(6000); available = true; } else if (e.Key == Key.Right && available) { available = false; data.gamePlay.playerMove(0, 1); await Task.Delay(6000); available = true; } else if (e.Key == Key.Escape) { data.gamePlay.gameState.stop(); UpdateViewCommand.getInstaince(MainViewModel.getInstaince()).Execute("mainMenue"); } }
public RegisterPageViewModel() { try { UpdateViewCommand = new UpdateViewCommand(this); Message = "Придумайте логин(от 5 до 20 символов) и пароль(от 8 до 20 символов). Логин и пароль могут содержать латинские символы и цифры"; usersDatum = new UsersDatum(); usersParam = new UsersParam(); usersParam.ParamsDate = DateTime.Now; usersDatum.Birthday = DateTime.Now; UserLastname = ""; UserSurname = ""; UserName = ""; UserWeight = 10; UserHeight = 50; } catch (Exception exception) { MessageBox.Show("Сообщение ошибки: " + exception.Message, "Произошла ошибка"); } }
private MainViewModel() { this.updateViewcommand = UpdateViewCommand.getInstaince(this); }
public MainViewModel() { UpdateViewCommand = new UpdateViewCommand(this); LanguageSetCommand = new Command.CommandManager(languageSet); }
public MainViewModel() { SelectedViewModel = new HRViewModel(this); UpdateView = new UpdateViewCommand(this); }
private MainMenueViewModel() { this.updateViewcommand = UpdateViewCommand.getInstaince(MainViewModel.getInstaince()); }
public LoginViewModel(MainWindowViewModel mainWindowViewModel) { LoginCommand = new LoginCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); }
/// <summary> /// Initializes a new instance of the <see cref="MainViewModel"/> class. /// </summary> /// <param name="main">The main.</param> public MainViewModel(MainWindow main) { UpdateViewCommand = new UpdateViewCommand(this, main); }
public EditNoteViewModel(MainWindowViewModel mainWindowViewModel) { _mainWindowViewModel = mainWindowViewModel; EditNoteCommand = new EditNoteCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); }
public MainViewModel() { UpdateViewCommand = new UpdateViewCommand(this); }
public MainWindowViewModel(IUnityContainer container) { _container = container; UpdateViewCommand = new UpdateViewCommand(this); }
public AddNewNoteViewModel(MainWindowViewModel mainWindowViewModel) { _mainWindowViewModel = mainWindowViewModel; AddNewNoteCommand = new AddNewNoteCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); }
public EditEntryViewModel(EntryViewModel currentContent, UpdateViewCommand updateViewCommand) { CurrentContent = currentContent; UpdateViewCommand = updateViewCommand; }
public SignUpViewModel(MainWindowViewModel mainWindowViewModel) { SignUpCommand = new SignUpCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); }
private ControlsViewModel() { updateViewcommand = UpdateViewCommand.getInstaince(MainViewModel.getInstaince()); }