Beispiel #1
0
        /* public ICollection<MachineInfo> GetLogData(ZkemClient objZkeeper, int dwMachineNumber)
         * {
         *     string dwEnrollNumber = "";
         *     int dwVerifyMode = 0;
         *     int dwInOutMode = 0;
         *     int dwYear = 0;
         *     int dwMonth = 0;
         *     int dwDay = 0;
         *     int dwHour = 0;
         *     int dwMinute = 0;
         *     int dwSecond = 0;
         *     int dwWorkCode = 0;
         *
         *     ICollection<MachineInfo> lstEnrollData = new List<MachineInfo>();
         *
         *         if (objZkeeper.ReadAllGLogData(dwMachineNumber))
         *         {
         *             //    bool SSR_GetGeneralLogData(int dwMachineNumber, out string dwEnrollNumber, out int dwVerifyMode, out int dwInOutMode, out int dwYear, out int dwMonth, out int dwDay, out int dwHour, out int dwMinute, out int dwSecond, ref int dwWorkCode)
         *             while (objZkeeper.SSR_GetGeneralLogData(dwMachineNumber, out dwEnrollNumber, out dwVerifyMode, out dwInOutMode, out dwYear, out dwMonth, out dwDay, out dwHour, out dwMinute, out dwSecond, ref dwWorkCode))
         *             {
         *                 string inputDate = new DateTime(dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond).ToString();
         *
         *                 MachineInfo objInfo = new MachineInfo();
         *                 objInfo.MachineNumber = dwMachineNumber;
         *                 objInfo.IndRegID = int.Parse(dwEnrollNumber);
         *                 objInfo.DateTimeRecord = inputDate;
         *
         *                 lstEnrollData.Add(objInfo);
         *             }
         *
         *             return lstEnrollData;
         *         }
         * } */

        public ICollection <UserIDInfo> GetAllUserID(ZkemClient objZkeeper, int dwMachineNumber)
        {
            int dwEnrollNumber     = 0;
            int dwEMachineNumber   = 0;
            int dwBackupNumber     = 0;
            int dwMachinePrivilege = 0;
            int dwEnable           = 0;

            ICollection <UserIDInfo> lstUserIDInfo = new List <UserIDInfo>();

            //bool GetAllUserID(int dwMachineNumber, ref int dwEnrollNumber, ref int dwEMachineNumber, ref int dwBackupNumber, ref int dwMachinePrivilege, ref int dwEnable)


            while (objZkeeper.GetAllUserID(dwMachineNumber, ref dwEnrollNumber, ref dwEMachineNumber, ref dwBackupNumber, ref dwMachinePrivilege, ref dwEnable))
            {
                UserIDInfo userID = new UserIDInfo();
                userID.BackUpNumber  = dwBackupNumber;
                userID.Enabled       = dwEnable;
                userID.EnrollNumber  = dwEnrollNumber;
                userID.MachineNumber = dwEMachineNumber;
                userID.Privelage     = dwMachinePrivilege;
                lstUserIDInfo.Add(userID);
            }
            return(lstUserIDInfo);
        }
Beispiel #2
0
        private void btnGetAllUserID_Click(object sender, EventArgs e)
        {
            try
            {
                // ICollection<UserIDInfo> lstUserIDInfo = manipulator.GetAllUserID(objZkeeper, int.Parse(tbxMachineNumber.Text.Trim()));

                int dwEnrollNumber     = 0;
                int dwEMachineNumber   = 0;
                int dwBackupNumber     = 0;
                int dwMachinePrivilege = 0;
                int dwEnable           = 1;
                int dwMachineNumber    = int.Parse(tbxMachineNumber.Text.Trim());
                ICollection <UserIDInfo> lstUserIDInfo = new List <UserIDInfo>();
                //bool GetAllUserID(int dwMachineNumber, ref int dwEnrollNumber, ref int dwEMachineNumber, ref int dwBackupNumber, ref int dwMachinePrivilege, ref int dwEnable)

                objZkeeper.ReadAllUserID(dwMachineNumber);

                while (objZkeeper.GetAllUserID(dwMachineNumber, ref dwEnrollNumber, ref dwEMachineNumber, ref dwBackupNumber, ref dwMachinePrivilege, ref dwEnable))
                {
                    UserIDInfo userID = new UserIDInfo();
                    userID.BackUpNumber  = dwBackupNumber;
                    userID.Enabled       = dwEnable;
                    userID.EnrollNumber  = dwEnrollNumber;
                    userID.MachineNumber = dwMachineNumber;
                    userID.Privelage     = dwMachinePrivilege;

                    lstUserIDInfo.Add(userID);
                }

                if (lstUserIDInfo != null && lstUserIDInfo.Count > 0)
                {
                    BindToGridView(lstUserIDInfo);
                    ShowStatusBar(lstUserIDInfo.Count + " records found !!", true);
                }
                else
                {
                    DisplayEmpty();
                    DisplayListOutput("No records found");
                }
            }
            catch (Exception ex)
            {
                DisplayListOutput(ex.Message);
            }
        }