Exemplo n.º 1
0
 /// <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();
 }
Exemplo n.º 2
0
        // 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();
        }
Exemplo n.º 3
0
        // 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();
        }
Exemplo n.º 4
0
 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;
     }
 }