示例#1
0
        /// <summary>
        /// Recupera la huella de un UsuarioID especifico.
        /// Nota: El usuarioId Interno del lector no debe superar los 9 caracteres
        /// </summary>
        /// <param name="usuarioID"></param>
        /// <returns></returns>
        public string RecuperarHuella(string usuarioID)
        {
            int    iTmpLength;
            string ibyTmpData;

            lectorObject.EnableDevice(Dispositivo, false);
            lectorObject.ReadAllTemplate(Dispositivo);
            if (lectorObject.GetUserTmpExStr(Dispositivo, usuarioID, iFingerIndex, out iFlag, out ibyTmpData, out iTmpLength))
            {
                HuellaDactilar h = new HuellaDactilar();
                lectorObject.RefreshData(Dispositivo);
                lectorObject.EnableDevice(Dispositivo, true);
                lectorObject.PlayVoiceByIndex(9);
                h.Identidad   = usuarioID;
                h.FingerIndex = iFingerIndex;
                h.byTmpData   = ibyTmpData;
                h.TmpLength   = iTmpLength;
                return(h.ToJSON());
            }
            else
            {
                lectorObject.RefreshData(Dispositivo);
                lectorObject.EnableDevice(Dispositivo, true);
                return(null);
            }
        }
        public CzkemUserTemp GetUserTemp(string userid, int index)
        {
            string data;
            int    length;
            int    flag;
            var    result = _czkem.GetUserTmpExStr(_czkem.MachineNumber, userid, index, out flag, out data, out length);

            if (result)
            {
                return(new CzkemUserTemp
                {
                    Index = index,
                    Data = data,
                    Length = length,
                    Flag = flag
                });
            }
            return(null);
        }
示例#3
0
 public bool GetUserTmpExStr(int dwMachineNumber, string dwEnrollNumber, int dwFingerIndex, out int Flag, out string TmpData, out int TmpLength)
 {
     return(objCZKEM.GetUserTmpExStr(dwMachineNumber, dwEnrollNumber, dwFingerIndex, out Flag, out TmpData, out TmpLength));
 }
示例#4
0
        private void btnFP_Click(object sender, EventArgs e)
        {
            ArrayList arQuery = new ArrayList();

            GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection();

            string sqlQuery = "", GetDeviceIP = "";
            string DeviceIp = "", pDate = "", pTime = "";

            string sdwEnrollNumber = "";
            string sName           = "";
            string sPassword       = "";
            int    iPrivilege      = 0;
            bool   bEnabled        = false;

            int    idwFingerIndex;
            string sTmpData   = "";
            int    iTmpLength = 0;
            int    iFlag      = 0;


            //Data Clear
            sqlQuery = "Truncate table tblTempCount_GTR";
            arQuery.Add(sqlQuery);
            clsCon.GTRSaveDataWithSQLCommand(arQuery);


            foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows)
            {
                if (row.Cells["Id"].Text.ToString().Length != 0 &&
                    row.Cells["isChecked"].Value.ToString() == "1" && row.Cells["Active"].Value.ToString() == "1")
                {
                    GetDeviceIP = "" + row.Cells["IpAddress"].Text.ToString() + "";

                    axCZKEM1.EnableDevice(iMachineNumber, false);
                    Cursor = Cursors.WaitCursor;

                    bIsConnected = axCZKEM1.Connect_Net(GetDeviceIP, 4370);
                    if (bIsConnected == true)
                    {
                        iMachineNumber = 1;
                        axCZKEM1.RegEvent(iMachineNumber, 65535);
                    }

                    axCZKEM1.ReadAllUserID(iMachineNumber);                                                                                          //read all the user information to the memory
                    axCZKEM1.ReadAllTemplate(iMachineNumber);                                                                                        //read all the users' fingerprint templates to the memory
                    while (axCZKEM1.SSR_GetAllUserInfo(iMachineNumber, out sdwEnrollNumber, out sName, out sPassword, out iPrivilege, out bEnabled)) //get all the users' information from the memory
                    {
                        for (idwFingerIndex = 0; idwFingerIndex < 10; idwFingerIndex++)
                        {
                            if (axCZKEM1.GetUserTmpExStr(iMachineNumber, sdwEnrollNumber, idwFingerIndex, out iFlag, out sTmpData, out iTmpLength))//get the corresponding templates string and length from the memory
                            {
                                sqlQuery = "Delete tblEmp_FingerData Where EmpId = '" + sdwEnrollNumber + "' and FPIndex = " + idwFingerIndex + "";
                                arQuery.Add(sqlQuery);

                                sqlQuery = "Insert into tblEmp_FingerData(ComId,EmpId,FingerData,FPIndex,Privilege,Password) values('2','" + sdwEnrollNumber + "','" +
                                           sTmpData + "'," + idwFingerIndex + "," + iPrivilege + ",'" + sPassword + "')";
                                arQuery.Add(sqlQuery);

                                sqlQuery = "Insert into tblTempCount_GTR(ComId,EmpId,FingerData,FPIndex,Privilege,Password) values('2','" + sdwEnrollNumber + "','" +
                                           sTmpData + "'," + idwFingerIndex + "," + iPrivilege + ",'" + sPassword + "')";
                                arQuery.Add(sqlQuery);
                            } //if
                        }     //for
                    }   //while

                    axCZKEM1.EnableDevice(iMachineNumber, true);
                    Cursor = Cursors.Default;
                }   //if


                axCZKEM1.Disconnect();
            }   //foreach

            clsCon.GTRSaveDataWithSQLCommand(arQuery);

            prcGetFingerData();
        }