示例#1
0
        public void SaveCardLog(string LogStr)
        {
            jsonBody <CardVerify> verifyPush = JsonConvert.DeserializeObject <jsonBody <CardVerify> >(LogStr);

            byte[] PhotoImage = null;
            int    InOutMode  = 0;
            string GUID       = "";

            MacSN         = verifyPush.info.DeviceID.ToString();
            attLog.Remark = verifyPush.info.CardNo;
            UInt32 FingerNo = 0;

            attLog          = new TSeaLog();
            attLog.CardID   = FingerNo.ToString("0000000000");
            attLog.CardTime = DateTime.Parse(verifyPush.info.CreateTime);
            attLog.FingerNo = FingerNo;
            if (!db.IsOpen)
            {
                db.Open(SystemInfo.ConnStr);
            }
            DataTableReader dr = db.GetDataReader("SELECT * FROM VSEA_MacInfoFace WHERE MacSN='" + MacSN + "'");

            if (dr.Read())
            {
                int.TryParse(dr["MacInOut"].ToString(), out InOutMode);
            }
            dr.Close();
            attLog.InOutMode = InOutMode;

            readData.Sea_SetLogName(attLog, InOutMode, 1, 21);

            readData.WriteTextFile(attLog, Int32.Parse(MacSN), true);
            if (textFormat.Allow)
            {
                readData.WriteTextFormat(db, textFormat, attLog, Int32.Parse(MacSN), true);
            }
            readData.SeaSaveDB(db, attLog, Int32.Parse(MacSN), FingerNo, PhotoImage);

            if (attLog.VerifyMode == 0)
            {
                attLog.VerifyMode     = attLog.DoorMode;
                attLog.VerifyModeName = attLog.DoorModeName;
            }

            readData.SeaSaveDBMJ(db, attLog, MacSN.ToString(), PhotoImage, ref GUID);
            if (prog != null)
            {
                prog(attLog, Int32.Parse(MacSN), GUID);
            }
        }
示例#2
0
        public void SaveCardLog(string LogStr)
        {
            jsonBody <CardVerify> verifyPush = JsonConvert.DeserializeObject <jsonBody <CardVerify> >(LogStr);

            byte[] PhotoImage = null;
            int    InOutMode  = 0;
            int    DevMode    = 0;

            MacSN         = verifyPush.info.DeviceID.ToString();
            attLog.Remark = verifyPush.info.CardNo;
            UInt32 FingerNo = 0;

            attLog          = new TFingerLog();
            attLog.CardID   = FingerNo.ToString("0000000000");
            attLog.CardTime = DateTime.Parse(verifyPush.info.CreateTime);
            attLog.FingerNo = FingerNo;

            DataTableReader dr = SystemInfo.db.GetDataReader("SELECT * FROM VDI_MacInfo WHERE MacSN='" + MacSN + "'");

            if (dr.Read())
            {
                int.TryParse(dr["InOutMode"].ToString(), out InOutMode);
                int.TryParse(dr["DevModeID"].ToString(), out DevMode);
            }
            dr.Close();
            attLog.InOutMode = InOutMode;

            readData.Sea_SetLogName(attLog, InOutMode, 1, 21);

            readData.WriteTextFile(attLog, MacSN);
            if (textFormat.Allow)
            {
                readData.WriteTextFormat(textFormat, attLog, MacSN);
            }
            if (DevMode == 0 || DevMode == 1)
            {
                readData.SaveDB(attLog, MacSN, true, ref GUID);
                if (GUID != "")
                {
                    if (PhotoImage != null)
                    {
                        readData.SaveDBPhoto(GUID, PhotoImage);
                    }
                }
            }

            if (attLog.VerifyMode == 0 || (attLog.VerifyMode != 2 && attLog.VerifyMode != 3))
            {
                attLog.VerifyMode     = attLog.DoorMode;
                attLog.VerifyModeName = attLog.DoorModeName;
            }

            readData.WriteTextFileMJ(attLog, MacSN);
            if (DevMode == 0 || DevMode == 2)
            {
                readData.SaveDBMJ(attLog, MacSN, true, ref GUID);
                if (GUID != "")
                {
                    if (PhotoImage != null)
                    {
                        readData.SaveDBPhotoMJ(GUID, PhotoImage);
                    }
                }
            }

            if (prog != null)
            {
                prog(1, 1, MacSN, attLog, GUID, true);
            }
        }
示例#3
0
        public void SaveFaceLog(string LogStr)
        {
            byte[] PhotoImage   = null;
            string InOutMode    = "";
            string VerifyStatus = "";
            int    DevMode      = 0;

            MonitoringLogs logs = JsonConvert.DeserializeObject <MonitoringLogs>(LogStr);

            MacSN = request.Headers.Get("dev_id");
            //获取设备模式
            DataTableReader dr = SystemInfo.db.GetDataReader("SELECT * FROM VDI_MacInfo WHERE MacSN='" + MacSN + "'");

            if (dr.Read())
            {
                Int32.TryParse(dr["DevModeID"].ToString(), out DevMode);
            }
            dr.Close();

            attLog        = new TFingerLog();
            attLog.Remark = request.Headers.Get("Host");
            UInt32 FingerNo = Convert.ToUInt32(logs.userId);

            attLog.CardID   = FingerNo.ToString("0000000000");
            attLog.CardTime = DateTime.Parse(readData.stringToTimeStr(logs.time));
            attLog.FingerNo = FingerNo;
            InOutMode       = logs.inOut;
            if (logs.doorMode == null)
            {
                attLog.DoorMode = 9;
            }
            else
            {
                attLog.DoorMode = readData.GetDoorMode(logs.doorMode);
            }
            VerifyStatus = logs.verifyMode;
            if (VerifyStatus != null)
            {
                attLog.VerifyMode = readData.GetVerifyModeID(VerifyStatus);
            }
            attLog.InOut  = readData.GetInOut(InOutMode);
            attLog.IoMode = logs.ioMode;
            readData.Star_SetLogName(attLog);
            bool IsKQ = readData.IsKQData(attLog);

            if (IsKQ)
            {
                readData.WriteTextFile(attLog, MacSN);
                if (textFormat.Allow)
                {
                    readData.WriteTextFormat(textFormat, attLog, MacSN);
                }
                if (DevMode == 0 || DevMode == 1)
                {
                    readData.SaveDB(attLog, MacSN, true, ref GUID);
                    if (GUID != "" && PhotoImage != null)
                    {
                        readData.SaveDBPhoto(GUID, PhotoImage);
                    }
                }
            }
            else
            {
                if (attLog.VerifyMode == 0)
                {
                    attLog.VerifyMode     = attLog.DoorMode;
                    attLog.VerifyModeName = attLog.DoorModeName;
                }
                readData.WriteTextFileMJ(attLog, MacSN);
                if (DevMode == 0 || DevMode == 2)
                {
                    readData.SaveDBMJ(attLog, MacSN, true, ref GUID);
                    if (GUID != "" && PhotoImage != null)
                    {
                        readData.SaveDBPhotoMJ(GUID, PhotoImage);
                    }
                }
            }
            if (IsKQ && attLog.DoorMode > 0)
            {
                attLog.VerifyMode     = attLog.DoorMode;
                attLog.VerifyModeName = attLog.DoorModeName;

                if (DevMode == 0 || DevMode == 2)
                {
                    readData.SaveDBMJ(attLog, MacSN, true, ref GUID);
                    if (GUID != "" && PhotoImage != null)
                    {
                        readData.SaveDBPhotoMJ(GUID, PhotoImage);
                    }
                }
            }

            if (prog != null)
            {
                prog(1, 1, MacSN, attLog, GUID, true);
            }
        }