示例#1
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     if (MessageBoxHelper.Confirm("清空指纹库将删除所有指纹吗?"))
     {
         FingerDbOperator.Clear();
         MessageBoxHelper.Show("清空成功!");
     }
 }
示例#2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     this.txtIdCard.Focus();
     FingerDbOperator.BindDict(this.cbLearnCar, "准驾车型");
     FingerDbOperator.BindDict(this.cbStudentType, "学员类型");
     this.cbLearnCar.SelectedValue = "C1";
     this.tabControl1.TabPages.RemoveAt(1);
     //this.tabControl1.TabPages[1].
 }
示例#3
0
 private void btnUpdateInfo_Click(object sender, EventArgs e)
 {
     if (this.txtIdCard.Text.Trim().Length == 0)
     {
         MessageBoxHelper.Show("身份证明号码为空,无法更新!");
     }
     else if (FingerDbOperator.UpdateInfo(this.txtIdCard.Text.Trim(), this.txtLsh.Text.Trim(), this.txtName.Text.Trim(), this.datePxrq.Value.ToString("yyyy-MM-dd"), this.cbStudentType.SelectedValue.ToString(), this.cbLearnCar.Text))
     {
         MessageBoxHelper.Show("更新身份证明号码为" + this.txtIdCard.Text.Trim() + "的学员资料成功!");
         this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
     }
 }
示例#4
0
        private void btnDeleteNow_Click(object sender, EventArgs e)
        {
            String idcard = this.txtIdCard.Text.Trim();

            if (idcard.Length == 0)
            {
                MessageBoxHelper.Show("请输入要删除的身份证号码!");
                return;
            }

            if (MessageBoxHelper.Confirm("确定要删除身份证明号码为" + idcard + "人员的指纹数据吗?"))
            {
                if (FingerDbOperator.DeleteUser(idcard))
                {
                    FingerDbOperator.ClearFingerAratek();
                    MessageBoxHelper.Show("删除用户成功!");
                    this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
                }
            }
        }
示例#5
0
        private void btnCollection_Click(object sender, EventArgs e)
        {
            String idcard = this.txtIdCard.Text.Trim();

            if (idcard.Length == 0)
            {
                MessageBoxHelper.Show("请输入要采集的身份证号码!");
                return;
            }
            string result = string.Empty;

            if (idcard.Length >= 15)
            {
                result = IDCardHelper.Validate(idcard);
                if (result != string.Empty)
                {
                    MessageBoxHelper.Show(result);
                    return;
                }
            }
            String name = this.txtName.Text.Trim();

            if (name.Length == 0)
            {
                MessageBoxHelper.Show("请输入要采集的姓名!");
                return;
            }
            //  if(FingerDbOperator.Exists(idcard))
            //  {
            //       MessageBoxHelper.Show("已存在身份证号码为"+idcard+"的指纹记录!");
            //      return;
            //   }

            int intResult = SUCCESSED;

            this.SetConfig();
            //if (FingerDbOperator.Exists(idcard))
            //{
            //FingerDbOperator.DeleteUser(idcard);
            //}

            intResult = _TG.NewEnroll(idcard);
            if (intResult == SUCCESSED)
            {
                MessageBoxHelper.Show("采集成功!");
                FingerDbOperator.Enroll(idcard, name, this.datePxrq.Value.ToString("yyyy-MM-dd"), this.cbStudentType.SelectedValue.ToString(), this.cbLearnCar.Text);
                // this.localFingerRecordSearch2.SetConditions(" c_name like '%'");
                // this.localFingerRecordSearch2.se
                this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
                //this.txtIdCard.Text = string.Empty;
                this.ClearInput();
                //this.localFingerRecordSearch2.SetMyConditon(string.Empty);

                // this.lo
            }
            else if (intResult == 404)
            {
                MessageBoxHelper.Show("使用者要求取消或者离开");
            }
            else if (intResult == 31)
            {
                MessageBoxHelper.Show("身份证号码" + idcard + "已经采集了指纹,请先删除该身份证的指纹后进行采集!");
                return;

                /*
                 * FingerDbOperator.DeleteUser(idcard);
                 * _TG.DeleteUser(idcard);
                 * intResult = _TG.NewEnroll(idcard);
                 * if (intResult == SUCCESSED)
                 * {
                 *  MessageBoxHelper.Show("更新采集成功!");
                 *  FingerDbOperator.Enroll(idcard, name, this.datePxrq.Value.ToString("yyyy-MM-dd"), this.cbStudentType.SelectedValue.ToString(), this.cbLearnCar.Text);
                 *  //this.localFingerRecordSearch2.SetConditions(" c_name like '%'");
                 *  //this.localFingerRecordSearch2.SetMyConditon(string.Empty);
                 *  this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
                 *  this.ClearInput();
                 *
                 *  // this.localFingerRecordSearch2.Refresh();
                 *
                 * }
                 */
            }
            else if (intResult == 40)
            {
                FingerDbOperator.ClearFingerAratek();
                System.Threading.Thread.Sleep(1000);
                intResult = _TG.NewEnroll(idcard);
                if (intResult == SUCCESSED)
                {
                    MessageBoxHelper.Show("采集成功!");
                    FingerDbOperator.Enroll(idcard, name, this.datePxrq.Value.ToString("yyyy-MM-dd"), this.cbStudentType.SelectedValue.ToString(), this.cbLearnCar.Text);
                    //  this.localFingerRecordSearch2.SetConditions(" c_name like '%'");
                    //  this.localFingerRecordSearch2.Refresh();
                    //this.localFingerRecordSearch2.SetMyConditon(string.Empty);
                    this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
                    this.ClearInput();
                }
                // MessageBoxHelper.Show("已经超出授权数量,无法采集!");
            }
            else if (intResult == 94 || intResult == 10)
            {
                MessageBoxHelper.Show("指纹采集数据库被使用中,请多点击几次或重启操作系统!" + intResult.ToString());
            }
            else
            {
                MessageBoxHelper.Show("指纹采集监控平台返回代码:" + intResult);

                //_TG.UpdateEnroll(idcard);
                // MessageBox.Show("更新采集成功!");
                // MessageBox.Show(Convert.ToString(_TG.LastErrCode)
                //  + "\n" + _TG.LastErrMsg
                // + "\n" + _TG.LastErrReason);
            }
        }
示例#6
0
 private void btnUpdateLsh_Click(object sender, EventArgs e)
 {
     FingerDbOperator.UpdateLsh(this.txtIdCard.Text.Trim(), this.txtLsh.Text.Trim());
     this.localFingerRecordSearch2.SetMyConditon(" c_name like '%'");
 }