コード例 #1
0
        public bool IsFaceMachine()
        {
            var faceMaxCount = 0;
            var result       = _czkem.GetDeviceStatus(_czkem.MachineNumber, 22, ref faceMaxCount);

            if (result)
            {
                if (faceMaxCount == 1904507651 || faceMaxCount == 0)
                {
                    result = false;
                }
            }
            return(result);
        }
コード例 #2
0
        public bool IsFaceMachine(CZKEM czkem)
        {
            var faceMaxCount = 0;            //1904507651

            czkem.GetDeviceStatus(czkem.MachineNumber, 22, ref faceMaxCount);
            if (faceMaxCount == 1904507651 || faceMaxCount == 0)
            {
                return(false);
            }
            return(true);
        }
コード例 #3
0
        private void prcDataLog()
        {
            ArrayList arQuery = new ArrayList();

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

            string sqlQuery = "", DeviceIP = "", GetDeviceIP = "";
            Int32  NewId = 0;
            Int32  RowID;

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

            int idwYear = 0, idwMonth = 0, idwDay = 0;
            int idwHour = 0, idwMinute = 0, idwSecond = 0;

            int idwErrorCode = 0;


            try
            {
                //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() + "";

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

                        int iValue = 0;

                        axCZKEM1.EnableDevice(iMachineNumber, true);                 //disable the device
                        if (axCZKEM1.GetDeviceStatus(iMachineNumber, 6, ref iValue)) //Here we use the function "GetDeviceStatus" to get the record's count.The parameter "Status" is 6.
                        {
                            //MessageBox.Show("The count of the AttLogs in the device is " + iValue.ToString(), "Success");

                            sqlQuery = "Insert into tblTempCount_GTR(ComId,IpAddress,Cnt) values(" + Common.Classes.clsMain.intComId + ",'" +
                                       GetDeviceIP + "','" + iValue + "')";
                            arQuery.Add(sqlQuery);
                        }
                        else
                        {
                            axCZKEM1.GetLastError(ref idwErrorCode);
                            MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
                        }
                        axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
                    }

                    axCZKEM1.Disconnect();
                }

                clsCon.GTRSaveDataWithSQLCommand(arQuery);

                prcGetDataLog();
            }//try

            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                arQuery = null;
                clsCon  = null;
            }
        }