private void ChangeUser(Window win) { MainWindow FirstWindow = new MainWindow(); showWindow.ShowWindow(FirstWindow); showWindow.CloseWindow(win); }
private void SetRightContacts(Window window) { Contacts = TmpContactsCompare; Persone.Name = CurPersoneCompare.Name; Persone.Surname = CurPersoneCompare.Surname; Persone.Patronimic = CurPersoneCompare.Patronimic; Persone.Male = CurPersoneCompare.Male; Persone.Female = CurPersoneCompare.Female; saveCompareResults = true;//этот маркер пока не востребован showWindow.CloseWindow(window); }
private void CheckPersone(object obj) { //Window win = obj as Window; var passwordBox = obj as PasswordBox; User.Pass = SHA.ComputeSHA256Hash(passwordBox.Password); passwordBox.Clear(); //check for exist eny user data in Users switch (FirstUserCheck()) { case CheckUser.Yes: //here we have user i identification and authorezation User = Identification(User); if (User != null) { //here we call main window fo work with application CallFirstWindow(User.UserId); showWindow.CloseWindow(win); } else { dialogService.ShowMessage("Не верная пара логин-пароль"); } User = new User(); break; case CheckUser.No: dialogService.ShowMessage("В БД нет ни одного пользователя. Нужно зарегистрироваться."); //here we call user registration window //this is relevat only at the first application start //UserRegistration usver; //usver = new UserRegistration(); //showWindow.ShowWindow(usver); break; case CheckUser.DB_trabl: dialogService.ShowMessage("Проблемы установки связи с базой данных..."); break; } }