public List <EmpleadoHuella> Get_Footprints_Employee(int machineNumber, int EnrollNumber, int id_empleado) { List <EmpleadoHuella> ListaHuellas = new List <EmpleadoHuella>(); string sdwEnrollNumber = string.Empty, sName = string.Empty, sPassword = string.Empty, sTmpData = string.Empty; int iTmpLength = 0, iFlag = 0, idwFingerIndex;; string Finger = string.Empty; objZkeeper.ReadAllUserID(machineNumber); objZkeeper.ReadAllTemplate(machineNumber); for (idwFingerIndex = 0; idwFingerIndex < 10; idwFingerIndex++) { objZkeeper.GetUserTmpExStr(machineNumber, EnrollNumber.ToString(), idwFingerIndex, out iFlag, out sTmpData, out iTmpLength); if (sTmpData != null) { EmpleadoHuella entidad = new EmpleadoHuella(); entidad.id_empleado = id_empleado; entidad.enrollnumber = EnrollNumber.ToString(); entidad.fingerIndex = idwFingerIndex.ToString(); entidad.flag = iFlag.ToString(); entidad.huella = sTmpData; entidad.tmplength = iTmpLength.ToString(); ListaHuellas.Add(entidad); } } return(ListaHuellas); }
public ActionResult ObtenerEmpleados() { string dwEnrollNumber = string.Empty; string name = string.Empty; string password = string.Empty; int privilege = 0; bool enabled = false; string tmpData = string.Empty; int tmpLength = 0; int flag = 0; var Listusuarios = new List <UserInfo>(); if (Connect()) { if (objZkeeper.ReadAllUserID(1)) { while (objZkeeper.SSR_GetAllUserInfo(1, out dwEnrollNumber, out name, out password, out privilege, out enabled)) { UserInfo Usuario = new UserInfo(); Usuario.EnrollNumber = dwEnrollNumber; Usuario.Name = name; Usuario.Privelage = privilege; Usuario.Password = password; Usuario.Enabled = enabled; Usuario.Fingers = new List <FingerUser>(); for (int i = 0; i < 10; i++) { if (objZkeeper.GetUserTmpExStr(1, dwEnrollNumber, i, out flag, out tmpData, out tmpLength)) { FingerUser item = new FingerUser { IndexFinger = i, B64Finger = tmpData, LongFinger = tmpLength }; Usuario.Fingers.Add(item); } } Listusuarios.Add(Usuario); } } } return(Json(new { data = Listusuarios }, JsonRequestBehavior.AllowGet)); }