private void Authapp() { //foreach (var usercrt in context.user) //{ // usercrt.Password = Encrypt.EncryptData(usercrt.Password); //} context.SaveChanges(); var user = Help.AuthSaveUser(); if (user != null) { Main.Main main = new Main.Main(user); main.Show(); MainWindow mainWindow = (MainWindow)Window.GetWindow(this); mainWindow.Hide(); } }
private void btnEntry_Click(object sender, EventArgs e) { int status = loginEngine.LoginControl(txtUserName.Text, txtPassword.Text); if (status == 0) { pnltxtPassword.BackColor = Color.Red; pnltxtUsername.BackColor = Color.Red; MessageBox.Show("Boş değer girdiniz veya şifreniz 8 Haneden Kısa", "Hatalı Giriş", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (status == 1) { Main.Main mainForm = new Main.Main(); mainForm.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı adı veya şifre hatalı\nTekrar Deneyiniz...", "Kayıt Bulunamadı...", MessageBoxButtons.OK, MessageBoxIcon.Error); pnltxtPassword.BackColor = Color.Red; pnltxtUsername.BackColor = Color.Red; } }
private void LogInSystem(object sender, RoutedEventArgs e) { if (capch.CapchText == CapchText.Text) { var user = Help.Auth(Login.Text, Pass.Text); if (user != null) { if (SaveMe.IsChecked.Value) { Help.AuthCreateFile(Login.Text, Pass.Text); } LockHelper.DeleteLock(Login.Text); SaveUserLog.SaveUser(user.Login); Main.Main main = new Main.Main(user); main.Show(); MainWindow mainWindow = (MainWindow)Window.GetWindow(this); mainWindow.Close(); } else { if (LockHelper.IsUserLock(Login.Text)) { this.IsEnabled = false; timerLock.Start(); } else { LockHelper.IncrementLockUser(Login.Text); } MsgBoxHelper.Warning("Такого пользователя нет"); } } else { MsgBoxHelper.Warning("Капча введена не верно"); } }