Example #1
0
        private void HandleLogin()
        {
            LoginForm loginForm = new LoginForm()
            {
                Owner = this
            };

            if (loginForm.ShowDialog() == DialogResult.OK)
            {
                String[] resultParams = loginForm.UserInfo.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if (int.TryParse(resultParams[1], out userId))
                {
                    userName              = resultParams[0];
                    lblMainTitle.Text    += userName;
                    tsmLogin.Text         = "Logout";
                    welcomeScreen.Visible = false;
                }
            }
        }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            LoginForm lg = new LoginForm();

            lg.ShowDialog();
            examCode = lg.codeExam;
            //this.Text = lg.username;
            // if (examCode != null)
            name = lg.username;
            //this.Text = "Welcome to : " + lg.username;
            LoadQuesionID(examCode);
            LoadQuesion();
            lblExamCode.Text = "Exam Code :" + examCode;
            //.ForeColor = Color.DarkBlue;

            lblName.Text = "Full Name :" + name;
            //lblName.ForeColor = Color.DarkBlue;
            //lblDate.Text = "Date : " + date;
            timer1.Start();
        }