Exemplo n.º 1
0
        private void bnEnroll_Click(object sender, EventArgs e)
        {
            userType = 0;


            var         registerUSerId = textBox1_SocialID.Text;
            ExAttDBRepo eA             = new ExAttDBRepo();
            ExUniDBRepo eU             = new ExUniDBRepo();

            var r = eA.IsRegisterdBefor(registerUSerId);

            if (r.Uni_ID > 0)
            {
                IsRegister = true;
                DisplayMessage("this Uni_ID Is registerd before", true);

                if (captureThread != null && captureThread.IsAlive)
                {
                    Utilities.EnableControls(false, btnEnroll);
                }
            }
            else
            {
                IsRegister = false;
            }
            var s  = eU.GetStudent(registerUSerId);
            var em = eU.GetEmployee(registerUSerId);


            if (em.Emp_ID < 1 && s.Stu_ID < 1)
            {
                DisplayMessage("this Uni_ID Is not found", true);
                IsRegister = true;
            }


            //else if (s.Stu_ID < 1 )
            //{
            //    DisplayMessage("this Uni_ID Is not found", true);
            //    IsRegister = true;

            //}

            if (!IsRegister)
            {
                ClearImage();
                IsRegister    = true;
                RegisterCount = 0;
                regTempLen    = 0;
                Utilities.EnableControls(false, btnEnroll, button1, btnVerify, btnIdentify);
                DisplayMessage("Please press your finger " + REGISTER_FINGER_COUNT + " times to register", true);

                lblFingerPrintCount.Visible = true;
                lblFingerPrintCount.Text    = REGISTER_FINGER_COUNT.ToString();
            }
            bnInit_Click();
        }
Exemplo n.º 2
0
        private void button1_CheckSOcialID_Click(object sender, EventArgs e)
        {
            userType = 0;
            ExAttDBRepo eA = new ExAttDBRepo();

            long selectedStudentId = 0;

            if (textBox1_SocialID.Text.Length > 0)
            {
                selectedStudentId = long.Parse(textBox1_SocialID.Text);

                CanRegisterId = false;

                var u = new ExUniDBRepo();
                var a = new ExAttDBRepo();

                var allStudents  = u.GetAllStudents();
                var allEmployees = u.GetAllEmployees();

                var selectedStudentModel  = allStudents.Where(su => su.Stu_ID == selectedStudentId).FirstOrDefault();
                var selectedEmoloyeeModel = allEmployees.Where(em => em.Emp_ID == selectedStudentId).FirstOrDefault();



                var r = eA.IsRegisterdBefor(textBox1_SocialID.Text);



                if (selectedStudentModel != null && selectedStudentModel.Stu_ID > 0)
                {
                    label2_searchResult.Text = selectedStudentModel.Stu_ID + "," + selectedStudentModel.Stu_First_Name + " " + selectedStudentModel.Stu_Last_Name;

                    if (captureThread != null && captureThread.IsAlive && r.Uni_ID < 1)
                    {
                        CanRegisterId = true;
                        Utilities.EnableControls(true, btnEnroll);
                    }
                }
                else if (selectedEmoloyeeModel != null && selectedEmoloyeeModel.Emp_ID > 0)
                {
                    label2_searchResult.Text = selectedEmoloyeeModel.Emp_ID + "," + selectedEmoloyeeModel.Emp_First_Name + " " + selectedEmoloyeeModel.Emp_Last_Name;

                    if (captureThread != null && captureThread.IsAlive && r.Uni_ID < 1)
                    {
                        CanRegisterId = true;

                        Utilities.EnableControls(true, btnEnroll);
                    }
                }
                else
                {
                    label2_searchResult.Text = "Not Found";
                    Utilities.EnableControls(false, btnEnroll);
                }

                //MessageBox.Show("Regidsterd Befor");
            }
            else
            {
                label2_searchResult.Text = "Please fill out this field";
            }
        }