public NavBarPageObject Login(String userName, String password) { TextLogin.SendKeys(userName); TextPassword.SendKeys(password); btnLogin.Click(); System.Threading.Thread.Sleep(1000); return(new NavBarPageObject(driver)); }
public Login() { InitializeComponent(); _userRepository = UnityInit.UnitOfWork.GetRepository <UserRepository>(); _systemSettingRepository = UnityInit.UnitOfWork.GetRepository <SystemSettingRepository>(); TxtVersion.Text = string.Format("当前版本号 : V{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); CheckBoxLogin.IsChecked = !string.IsNullOrEmpty(Settings.Default.Login); TextLogin.Text = Settings.Default.Login; if (string.IsNullOrEmpty(TextLogin.Text)) { TextLogin.Focus(); } else { TextPassword.Focus(); } }
private void CreateNewAdministrator(object sender, EventArgs e) { if (TextLogin.Text == "") { MessageBox.Show("Введите логин!"); TextLogin.Focus(); } else if (TextPassword.Text == "") { MessageBox.Show("Введите пароль!"); TextPassword.Focus(); } else { conn.Open(); sql = "SELECT COUNT(*) FROM INFO WHERE INFO_LOGIN = '******'"; MySqlCommand querycheckadm = new MySqlCommand(sql, conn); COUNT = Convert.ToInt32(querycheckadm.ExecuteScalar()); if (COUNT == 0) { sql = "INSERT INTO INFO (INFO_LOGIN, INFO_PASSWORD) VALUES ('" + TextLogin.Text + "','" + TextPassword.Text + "')"; MySqlCommand cmd = new MySqlCommand(sql, conn); if (cmd.ExecuteNonQuery() == 1) { MessageBox.Show("Пользователь успешно создан!"); this.Close(); AdminMainForm amf = new AdminMainForm(); amf.Show(); conn.Close(); } else { MessageBox.Show("Запись не удалась"); conn.Close(); } } else { MessageBox.Show("Такой пользователь уже существует!"); conn.Close(); } } }
public Logowanie() { InitializeComponent(); TextLogin.Focus(); }