Esempio n. 1
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     picLoading.Visible = false;
     btnCheckin.Enabled = true;
     txtEmail.Enabled   = true;
     if (authorizedPeserta == true)
     {
         hidecontrol();
         FormParticipantCheckin s = new FormParticipantCheckin(currentPes, ses);
         s.ShowDialog();
         if (s.DialogResult == DialogResult.OK)
         {
             showcontrol();
             txtEmail.Text      = "Enter your email here";
             txtEmail.ForeColor = Color.Gray;
             label2.Focus();
         }
     }
     else
     {
         if (ad.CheckStatusCheckin(Currentemail, ses.sessionID) == "Checkedin")
         {
             MessageBox.Show("You have done the check-in. Thank you.");
             txtEmail.Text      = "Enter your email here";
             txtEmail.ForeColor = Color.Gray;
             label2.Focus();
         }
         else
         {
             attemp += 1;
             if (attemp >= 3)
             {
                 MessageBox.Show("There must be a mistake, please refer to our officers.");
                 txtEmail.Text      = "Enter your email here";
                 txtEmail.ForeColor = Color.Gray;
                 label2.Focus();
             }
             else
             {
                 MessageBox.Show("Sorry, you entered wrong email. Please try again.");
                 txtEmail.Text      = "Enter your email here";
                 txtEmail.ForeColor = Color.Gray;
                 label2.Focus();
             }
         }
     }
 }
Esempio n. 2
0
        private void checkin()
        {
            bool auth = ad.Checkin(txtEmail.Text, ses.sessionID);

            if (auth == true)
            {
                Peserta p = ad.getPeserta(ad.getPesertaID(txtEmail.Text));
                //MessageBox.Show("Welcome " + p.nama + " !");
                hidecontrol();
                FormParticipantCheckin s = new FormParticipantCheckin(p, ses);
                s.ShowDialog();
                if (s.DialogResult == DialogResult.OK)
                {
                    showcontrol();
                    txtEmail.Text      = "Enter your email here";
                    txtEmail.ForeColor = Color.Gray;
                    label2.Focus();
                }
            }
            else
            {
                if (ad.CheckStatusCheckin(txtEmail.Text, ses.sessionID) == "Checkedin")
                {
                    MessageBox.Show("You have done the check-in. Thank you.");
                }
                else
                {
                    attemp += 1;
                    if (attemp >= 3)
                    {
                        MessageBox.Show("There must be a mistake, please refer to our officers.");
                    }
                    else
                    {
                        MessageBox.Show("Sorry, you entered wrong email. Please try again.");
                    }
                }
            }
        }