Exemplo n.º 1
0
        /// <summary>
        /// 指纹添加
        /// </summary>
        /// <param name="fingerResult"></param>
        public static void AddFingerPrintByUser(FingerResult fingerResult)
        {
            UserInfos userInfo = PoliceInfos.Find(p => p.UserID.Equals(fingerResult.UserID));

            if (userInfo == null)
            {
                return;
            }

            userInfo.Fingers.Add(new Finger()
            {
                FingerID = fingerResult.FingerID, FingerName = fingerResult.FingerName
            });
            userInfo.FingerNumber = userInfo.Fingers.Count;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑结果修改
        /// </summary>
        /// <param name="fingerResult"></param>
        public static void EditorFingerPrintByUserID(FingerResult fingerResult)
        {
            UserInfos userInfo = PoliceInfos.Find(p => p.UserID.Equals(fingerResult.UserID));

            if (userInfo == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(fingerResult.FingersEditor))
            {
                string[] fingers = fingerResult.FingersEditor.Split(',');
                foreach (var item in fingers)
                {
                    string[] fingerInfo = item.Split(':');
                    if (fingerInfo.Length != 2)
                    {
                        continue;
                    }

                    Finger finger = userInfo.Fingers.Find(p => p.FingerID.Equals(fingerInfo[0]));
                    if (finger != null)
                    {
                        finger.FingerName = fingerInfo[1];
                    }
                }
            }

            if (!string.IsNullOrEmpty(fingerResult.FingersDelete))
            {
                string[] fingerIds = fingerResult.FingersDelete.Split(',');
                foreach (var item in fingerIds)
                {
                    Finger finger = userInfo.Fingers.Find(p => p.FingerID.Equals(item));
                    if (finger != null)
                    {
                        userInfo.Fingers.Remove(finger);
                    }
                }

                userInfo.FingerNumber = userInfo.Fingers.Count;
            }
        }