コード例 #1
0
ファイル: Login.cs プロジェクト: rtanyildizi/microwave-lms
        private void btn_login_click()
        {
            email    = this.tb_email.Text.Trim();
            password = this.tb_password.Text.Trim();

            if (email == "")
            {
                lbl_message.Text      = "*Please enter a valid email";
                lbl_message.ForeColor = Color.Red;
                return;
            }

            if (password == "")
            {
                lbl_message.Text      = "*Please enter a valid password";
                lbl_message.ForeColor = Color.Red;
                return;
            }

            manager = SystemManager.Login(email, password);
            if (manager == null)
            {
                this.lbl_message.Text      = "*Wrong email or password!";
                this.lbl_message.ForeColor = Color.Red;
                return;
            }
            else
            {
                MessageBox.Show("Login is successful. Please wait a while...", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            Microwave microwave = new Microwave(manager);

            microwave.Show();
            this.Hide();
        }