private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMainPage main = new FormMainPage();

            this.Hide();
            main.Show();
        }
        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMainPage mainpage = new FormMainPage();

            this.Hide();
            mainpage.Show();
        }
Пример #3
0
        private void QuizTimer_Tick(object sender, EventArgs e)
        {
            duration--;
            if (duration == 10)
            {
                lbltimerSet.ForeColor = Color.Red;
            }
            if (duration == 0)
            {
                QuizTimer.Stop();
                int      qmarks   = Convert.ToInt16(marks);
                DateTime today    = DateTime.Now;
                string   current  = today.ToString("MM/dd/yyyy");
                string   getMarks = Session.logedInType.ToString();
                int      cal      = qmarks * 10;
                string   qmark    = "" + cal + "";
                try
                {
                    db.marksAdd(getMarks, qmark, qmarks);
                    MessageBox.Show("Your marks is   :" + cal + "   successfuly added to the database......");
                    FormMainPage log = new FormMainPage();
                    this.Hide();
                    log.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            lbltimerSet.Text = duration.ToString();
        }
Пример #4
0
 private void PbLogin_Click(object sender, EventArgs e)
 {
     if (txtlog_uname.Text == "" || txtlog_pass.Text == "")
     {
         MessageBox.Show("Provide both Username and Password", "Invalid Data", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         bool loged = db.AuthenticateUser(txtlog_uname.Text.ToString(), txtlog_pass.Text.ToString());
         if (loged)
         {
             db.SetSession(txtlog_uname.Text.ToString());
             clear();
             FormMainPage mainpage = new FormMainPage();
             mainpage.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Invalied Username or Password", "Invalid Data", MessageBoxButtons.OK, MessageBoxIcon.Error);
             clear();
         }
     }
 }