private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); try { if (textBox1.Text == "") { return; } string temp_text = textBox1.Text.Replace("\n", ""); StudentProfile studentProfile = General.GetProfileFromBarcode(temp_text, databasePath); label8.Text = "ID: " + studentProfile.ID.ToString(); label9.Text = "Name: " + studentProfile.name.ToString(); button4.Focus(); if (General.FindAttendanceRecord(Convert.ToInt32(label8.Text.Replace("ID:", "")), databasePath) == null) { groupBox4.Enabled = true; } else { groupBox4.Enabled = false; } } catch { MessageBox.Show("Profile not found, add user first", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; } }