示例#1
0
        private void LinkAdmin_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            frmAdminLogin adminlogin = new frmAdminLogin();

            adminlogin.ShowDialog();
            this.Close();
        }
示例#2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            FileFunctions filefuncs = new FileFunctions();

            if (filefuncs.checkUser(txtUsername.Text, "admins.csv"))
            {
                MessageBox.Show("An account already exists with this username.");
            }
            else if (txtPassword.Text != txtConfirm.Text)
            {
                MessageBox.Show("Passwords must match.");
            }
            else
            {
                User.Name     = txtName.Text;
                User.Username = txtUsername.Text;
                User.Password = txtPassword.Text;
                filefuncs.writeUser("admins.csv");
                this.Hide();
                frmAdminLogin adminlogin = new frmAdminLogin();
                adminlogin.ShowDialog();
            }
        }