public ActionResult ObtenerEnrollnumber(int id_dispositivo) { string dwEnrollNumber = string.Empty; string name = string.Empty; string password = string.Empty; int privilege = 0; bool enabled = false; string tmpData = string.Empty; int Enrollnumber = 0; var Listusuarios = new List <UserInfo>(); EntDispositivo entidadDisp = ctrlDispositivo.Obtener(id_dispositivo); if (Connect(entidadDisp.ip_dispositivo, int.Parse(entidadDisp.puerto))) { if (objZkeeper.ReadAllUserID(entidadDisp.numeroequipo)) { while (objZkeeper.SSR_GetAllUserInfo(1, out dwEnrollNumber, out name, out password, out privilege, out enabled)) { Enrollnumber++; } } } return(Json(new { data = Enrollnumber + 1 }, JsonRequestBehavior.AllowGet)); }
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)); }