Ejemplo n.º 1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //Opens the Registration Form
            RegisterForm rf = new RegisterForm();

            rf.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //Trying to open the connection
            try
            {
                Connection.connection.Open();
                Connection.isConnectedToTheServer = true;
            }
            catch
            {
                //If the connection to the server isn't there, tell the user
                Connection.isConnectedToTheServer = false;

                MessageBox.Show(
                    "Not connected to the server! Follow readme.txt",
                    "ERROR",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
            }

            //Creates other forms and making them reachable from the controller class
            Controller.loginForm = this;

            RegisterForm rf = new RegisterForm();

            Controller.registerForm = rf;

            MainForm mainForm = new MainForm();

            Controller.mainForm = mainForm;

            //If there is no connection to the server, close the whole application (all forms)
            if (!Connection.isConnectedToTheServer)
            {
                Application.Exit();
            }
        }