コード例 #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 SaveFaceLog(string LogStr)
        {
            byte[]                              PhotoImage         = null;
            DataTableReader                     dr                 = null;
            int                                 InOutMode          = 0;
            int                                 VerifyStatus       = 0;
            int                                 VerifyType         = 0;
            string                              GUID               = "";
            VerifyPush <VerifyPushInfo>         verifyPush         = null;
            VerifyPush <RemoteOpenDoorPushInfo> remoteOpenDoorPush = null;

            if (LogStr.Contains("RemoteOpenDoorPush"))
            {
                remoteOpenDoorPush = JsonConvert.DeserializeObject <VerifyPush <RemoteOpenDoorPushInfo> >(LogStr);
                MacSN         = remoteOpenDoorPush.info.DeviceID.ToString();
                attLog.Remark = "";
                UInt32 FingerNo = 0;
                attLog          = new TSeaLog();
                attLog.CardID   = FingerNo.ToString("0000000000");
                attLog.CardTime = DateTime.Parse(remoteOpenDoorPush.info.CreateTime);
                attLog.FingerNo = FingerNo;
                VerifyStatus    = 27;
                VerifyType      = remoteOpenDoorPush.info.VerfyType;
            }
            else
            {
                verifyPush    = JsonConvert.DeserializeObject <VerifyPush <VerifyPushInfo> >(LogStr);
                MacSN         = verifyPush.info.DeviceID.ToString();
                attLog.Remark = verifyPush.info.Notes;
                UInt32 FingerNo = 0;
                UInt32.TryParse(verifyPush.info.ToString(), out FingerNo);
                attLog                  = new TSeaLog();
                attLog.CardID           = FingerNo.ToString("0000000000");
                attLog.CardTime         = DateTime.Parse(verifyPush.info.CreateTime);
                attLog.FingerNo         = FingerNo;
                attLog.Temperature      = verifyPush.info.Temperature;
                attLog.TemperatureAlarm = verifyPush.info.TemperatureAlarm;
                VerifyType              = verifyPush.info.VerfyType;
                VerifyStatus            = verifyPush.info.VerifyStatus;
                if (verifyPush.SanpPic != null)
                {
                    PhotoImage = Convert.FromBase64String(verifyPush.SanpPic.Replace("data:image/jpeg;base64,", ""));
                }
                else
                {
                    PhotoImage = new byte[0];
                }
            }
            if (!db.IsOpen)
            {
                db.Open(SystemInfo.ConnStr);
            }
            dr = db.GetDataReader("SELECT * FROM VSEA_MacInfoFace WHERE MacSN='" + MacSN + "'");
            if (dr.Read())
            {
                int.TryParse(dr["MacInOut"].ToString(), out InOutMode);
            }
            dr.Close();
            readData.Sea_SetLogName(attLog, InOutMode, VerifyStatus, VerifyType);
            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), attLog.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);
            }
        }
コード例 #3
0
        public void ShowRealDataProcess(TSeaLog attLog, int MacSN, string GUID)
        {
            string          EmpSysID   = "";
            string          EmpNo      = "";
            string          EmpName    = "";
            string          DepartID   = "";
            string          DepartName = "";
            DataTableReader dr         = null;

            try
            {
                dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_001003, new string[] { "240", attLog.CardID }));
                if (dr.Read())
                {
                    EmpSysID   = dr["EmpSysID"].ToString();
                    EmpNo      = dr["EmpNo"].ToString();
                    EmpName    = dr["EmpName"].ToString();
                    DepartID   = dr["DepartID"].ToString();
                    DepartName = dr["DepartName"].ToString();
                }
            }
            catch
            {
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
                dr = null;
            }
            if (realGrid.RowCount > 0)
            {
                if (realGrid[1, realGrid.RowCount - 1].Value.ToString() == attLog.CardTime.ToString() && realGrid[2, realGrid.RowCount - 1].Value.ToString() == MacSN.ToString())
                {
                    return;
                }
            }

            realGrid.Rows.Add();
            realGrid[0, realGrid.RowCount - 1].Value      = Convert.ToInt32(attLog.CardID);
            realGrid[1, realGrid.RowCount - 1].Value      = attLog.CardTime;
            realGrid[2, realGrid.RowCount - 1].Value      = MacSN;
            realGrid[3, realGrid.RowCount - 1].Value      = EmpNo;
            realGrid[4, realGrid.RowCount - 1].Value      = EmpName;
            realGrid[5, realGrid.RowCount - 1].Value      = DepartID;
            realGrid[6, realGrid.RowCount - 1].Value      = DepartName;
            realGrid[7, realGrid.RowCount - 1].Value      = EmpSysID;
            realGrid[8, realGrid.RowCount - 1].Value      = GUID;
            realGrid.Rows[realGrid.RowCount - 1].Selected = true;


            realGrid.CurrentCell = realGrid.Rows[realGrid.RowCount - 1].Cells[0];
            if (realGrid.RowCount == 1)
            {
                realGrid_SelectionChanged(null, null);
            }
            //if (!SystemInfo.UseRealSendKQ || !objRealSend.IsInit) return;
            //string PhotoData = RealSendPhoto ? ShowEmpPhoto(false) : "";

            //objRealSend.SendDataKQ(MacSN.ToString(), EmpNo, EmpName, DepartID, DepartName, attLog.CardID, attLog.Time, PhotoData);
        }