示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int cont = cs.Usuario().Rows.Count;
            int i    = 0;

            while (i < cont)
            {
                if (textBox1.Text == Convert.ToString(cs.Usuario().Rows[i]["cod"].GetHashCode()))
                {
                    aux = i;
                }
                i = i + 1;
            }

            if (cs.Usuario().Rows[aux]["digital"].ToString() == null || cs.Usuario().Rows[aux]["digital"].ToString() == "")
            {
                if (textBox1.Text == "" || textBox1.Text == "")
                {
                    MessageBox.Show("Selecione um nome na lista ao lado");
                }
                else
                {
                    button1.Enabled = false;
                    button2.Enabled = true;
                    reg.FPRegistrationStart("MySecretKey" + textBox1.Text);
                }
            }
            else
            {
                MessageBox.Show("Alpinista já possui digital cadastrada");
                textBox1.Text = "";
                textBox2.Text = "";
            }
        }
示例#2
0
        private void btnFingerprint_Click(object sender, EventArgs e)
        {
            log.Debug("IN");

            try
            {
                if (txtUserID.Text == "")
                {
                    MessageBox.Show("Please enter ID before recording fingerprint.");
                }
                else
                {
                    btnFingerprint.Enabled = false;
                    reg.FPRegistrationStart("MySecretKey" + txtUserID.Text);
                }
            }
            catch (Exception ex)
            {
                log.Error("Error", ex);
                MessageBox.Show(ex.Message, "Error - " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }