/// <summary> /// This method is activated by the Mainform when a user is logging out. /// Kills the Mainform and blanks the entered username and password. /// </summary> public void Logout() { // unset all the data lblIncorrect.Visible = false; tbUsername.Text = ""; tbPassword.Text = ""; tbUsername.Focus(); parentForm.Close(); parentForm = null; this.Show(); }
// Constructor to setup for a new door. public DoorDialog(ObjectHolder objects, MDI_ParentForm parent) { InitializeComponent(); this.objects = objects; this.parent = parent; this.door = new Door(); buttonDelete.Visible = false; buttonMap.Visible = false; PopulateKeyTree(); PopulateComboBox(); }
// Constructor to edit an existing door public DoorDialog(ObjectHolder objects, MDI_ParentForm parent, Door door) { InitializeComponent(); this.objects = objects; this.parent = parent; this.door = door; textBoxRoom.Text = door.RoomNumber; labelTitle.Text = "Edit Door"; this.Text = "Edit Door"; buttonCreate.Text = "Update"; PopulateKeyTree(); PopulateUnlockingTree(); PopulateComboBox(); }
private void btnLogin_Click(object sender, EventArgs e) { String username = tbUsername.Text; String password = tbPassword.Text; int userId = GetUserID(username, password); if (userId != -1) { parentForm = new MDI_ParentForm(this, userId); parentForm.Show(); this.Hide(); } else { lblIncorrect.Visible = true; } }