public Person(string id, string name, string surname, int age, string rank, string password) { cipher = new Cipher(); this.id = id; this.name = name; this.surname = surname; this.age = age; this.rank = rank; this.username = this.Name.Substring(0, 3) + this.Surname.Substring(this.Surname.Length - 2, 2); this.password = cipher.Shift(password, 3); }
private void BtnLogin_Click(object sender, EventArgs e) { if ((TxtUsername.Text.Length > 0) && (TxtPassword.Text.Length > 0)) { foreach (string[] login in lm.Logins) { if ((login[0].ToLower() == TxtUsername.Text.ToLower()) && (login[1] == cipher.Shift(TxtPassword.Text, 3))) { MessageBox.Show("Successful Login", "Login Attempt", MessageBoxButtons.OK, MessageBoxIcon.Information); FrmWelcomeScreen welcomeScreen = new FrmWelcomeScreen(pm.IsAboveOfficer(login[0]), login[0]); this.Hide(); welcomeScreen.ShowDialog(); this.Close(); } } } }