Example #1
0
        public ICollection <UserInfo> GetAllUserInfo(ZkemClient objZkeeper, int dwMachineNumber, int count)
        {
            string dwEnrollNumber = "";
            string Name           = "";
            string Password       = "";
            int    Privilege      = 0;
            bool   Enabled        = false;
            int    dwFingerIndex;
            string TmpData   = "";
            int    TmpLength = 0;
            int    Flag      = 0;


            ICollection <UserInfo> lstFPTemplates = new List <UserInfo>();

            objZkeeper.ReadAllUserID(dwMachineNumber);
            objZkeeper.ReadAllTemplate(dwMachineNumber);
            // bool SSR_GetAllUserInfo(int dwMachineNumber, out string dwEnrollNumber, out string Name, out string Password, out int Privilege, out bool Enabled)

            while (objZkeeper.SSR_GetAllUserInfo(dwMachineNumber, out dwEnrollNumber, out Name, out Password, out Privilege, out Enabled))
            {
                for (dwFingerIndex = 0; dwFingerIndex < 10; dwFingerIndex++)
                {
                    //  bool SSR_GetUserTmpStr(int dwMachineNumber, string dwEnrollNumber, int dwFingerIndex, out string TmpData, out int TmpLength)
                    if (objZkeeper.SSR_GetUserTmpStr(dwMachineNumber, dwEnrollNumber, dwFingerIndex, out TmpData, out TmpLength))
                    {
                        UserInfo fpInfo = new UserInfo();
                        fpInfo.MachineNumber = dwMachineNumber;
                        fpInfo.EnrollNumber  = dwEnrollNumber;
                        fpInfo.Name          = Name;
                        fpInfo.FingerIndex   = dwFingerIndex;
                        fpInfo.TmpData       = TmpData;
                        fpInfo.Privelage     = Privilege;
                        fpInfo.Password      = Password;
                        fpInfo.Enabled       = Enabled;
                        fpInfo.iFlag         = Flag.ToString();

                        lstFPTemplates.Add(fpInfo);
                    }
                }
            }
            return(lstFPTemplates);
        }
Example #2
0
        private void btnDownloadFingerPrint_Click(object sender, EventArgs e)
        {
            try
            {
                ShowStatusBar(string.Empty, true);
                ICollection <UserIDInfo> lstUserIDInfo = manipulator.GetAllUserID(objZkeeper, int.Parse(tbxMachineNumber.Text.Trim()));
                //  ICollection<UserInfo> lstFingerPrintTemplates = manipulator.GetAllUserInfo(objZkeeper, int.Parse(tbxMachineNumber.Text.Trim()), lstUserIDInfo.Count);
                string dwEnrollNumber = "";
                string Name           = "";
                string Password       = "";
                int    Privilege      = 0;
                bool   Enabled        = false;
                int    dwFingerIndex;
                string TmpData         = "";
                int    TmpLength       = 0;
                int    Flag            = 0;
                int    dwMachineNumber = int.Parse(tbxMachineNumber.Text.Trim());
                int    c = 0;
                ICollection <UserInfo> lstFPTemplates = new List <UserInfo>();

                objZkeeper.ReadAllUserID(dwMachineNumber);
                objZkeeper.ReadAllTemplate(dwMachineNumber);
                // bool SSR_GetAllUserInfo(int dwMachineNumber, out string dwEnrollNumber, out string Name, out string Password, out int Privilege, out bool Enabled)



                while (objZkeeper.SSR_GetAllUserInfo(dwMachineNumber, out dwEnrollNumber, out Name, out Password, out Privilege, out Enabled))
                {
                    c++;
                    for (dwFingerIndex = 0; dwFingerIndex < 10; dwFingerIndex++)
                    {
                        //  bool SSR_GetUserTmpStr(int dwMachineNumber, string dwEnrollNumber, int dwFingerIndex, out string TmpData, out int TmpLength)
                        if (objZkeeper.SSR_GetUserTmpStr(dwMachineNumber, dwEnrollNumber, dwFingerIndex, out TmpData, out TmpLength))
                        {
                            UserInfo fpInfo = new UserInfo();
                            fpInfo.MachineNumber = dwMachineNumber;
                            fpInfo.EnrollNumber  = dwEnrollNumber;
                            fpInfo.Name          = Name;
                            fpInfo.FingerIndex   = dwFingerIndex;
                            fpInfo.TmpData       = TmpData;
                            fpInfo.Privelage     = Privilege;
                            fpInfo.Password      = Password;
                            fpInfo.Enabled       = Enabled;
                            fpInfo.iFlag         = Flag.ToString();
                            BindToGridView(fpInfo);
                            ShowStatusBar(dwEnrollNumber, true);
                            lstFPTemplates.Add(fpInfo);
                        }
                    }
                }

                BindToGridView(lstFPTemplates);

                if (lstFPTemplates.Count > 0)
                {
                    //BindToGridView(lstFingerPrintTemplates);
                    // ShowStatusBar(lstFPTemplates.Count + " records found !!"+"RunCount="+ c, true);
                }
                else
                {
                    DisplayListOutput("No records found");
                }
            }
            catch (Exception ex)
            {
                DisplayListOutput(ex.Message);
            }
        }