예제 #1
0
        /// <summary> 写入数据库 </summary>
        protected override void InSession()
        {
            try
            {
                //写入本地记录并且通知
                var info = new SessionsInfo
                {
                    SessionId    = MyMatch.SessionId,
                    CreateDate   = DateTime.Now,
                    Name         = MyMatch.SessionName,
                    IdNo         = Cvr.Info.Number,
                    IdCardPhoto  = IrAdvanced.ReadBytesFromFile(FaceFun.BaseDir + "\\pic.bmp"),
                    TakePhoto    = PhotoOk,
                    FaceData     = FaceFun.StructToBytes(CameraRft),
                    IdAddress    = Cvr.Info.Address,
                    TicketType   = 2,
                    TicketNo     = null,
                    Area         = null,
                    Row          = null,
                    Seat         = null,
                    TelNo        = IrAdvanced.ReadString("TelNo"),
                    TelArea      = IrAdvanced.ReadString("TelArea"),
                    BuyName      = Cvr.Info.Name,
                    BuyPhoto     = null,
                    BuyDate      = null,
                    ValidateType = 1,
                    SyncTime     = null,
                    Status       = 0,
                    Remark       = "",
                    UserName     = AftUserName,
                };

                if (FaceFun.AddSessions(info) > 0)
                {
                    Dispatcher.InvokeAsync(() =>
                    {
                        MiniImg.Source = FaceFun.ByteToBitmapImage(PhotoOk);
                    });
                    base.InSession();
                }
                else
                {
                    "写入数据库失败".ToSaveLog("入场记录时:");
                }
            }
            catch (Exception ex)
            {
                ex.ToSaveLog("InSession");
            }
        }
예제 #2
0
        /// <summary> 写入本地记录并且通知 </summary>
        protected override void InSession()
        {
            //写入本地记录并且通知
            var info = new SessionsInfo
            {
                SessionId    = MyMatch.SessionId,
                CreateDate   = DateTime.Now,
                Name         = MyMatch.SessionName,
                IdNo         = Cvr.Info.Number,
                IdCardPhoto  = IrAdvanced.ReadBytesFromFile(FaceFun.BaseDir + "\\pic.bmp"),
                TakePhoto    = PhotoOk,
                FaceData     = FaceFun.StructToBytes(CameraRft),
                IdAddress    = Cvr.Info.Address,
                TicketType   = 0,
                TicketNo     = _qrInfo.Value.TicketNo,
                Area         = _qrInfo.Value.Area,
                Row          = _qrInfo.Value.Row,
                Seat         = _qrInfo.Value.Seat,
                TelNo        = IrAdvanced.ReadString("TelNo"),
                TelArea      = IrAdvanced.ReadString("TelArea"),
                BuyName      = Cvr.Info.Name,
                BuyPhoto     = null,
                BuyDate      = null,
                ValidateType = 3,
                SyncTime     = null,
                Status       = 0,
                Remark       = "",
                UserName     = AftUserName,
            };

            if (FaceFun.AddSessions(info) > 0)
            {
                ShowEventMsg("检票成功", MsgType.FaceOk);
            }
            else
            {
                "写入数据库失败".ToSaveLog("入场记录时:");
                ShowEventMsg("检票失败", MsgType.FaceErr);
            }
        }
예제 #3
0
        /// <summary> 写入数据库 </summary>
        protected override void InSession()
        {
            try
            {
                //写入本地记录并且通知
                var info = new SessionsInfo
                {
                    SessionId    = MyMatch.SessionId,
                    CreateDate   = DateTime.Now,
                    Name         = MyMatch.SessionName,
                    IdNo         = Cvr.Info.Number,
                    IdCardPhoto  = IrAdvanced.ReadBytesFromFile(FaceFun.BaseDir + "\\pic.bmp"),
                    TakePhoto    = PhotoOk,
                    FaceData     = FaceFun.StructToBytes(CameraRft),
                    IdAddress    = Cvr.Info.Address,
                    TicketType   = 2,
                    TicketNo     = null,
                    Area         = null,
                    Row          = null,
                    Seat         = null,
                    TelNo        = IrAdvanced.ReadString("TelNo"),
                    TelArea      = IrAdvanced.ReadString("TelArea"),
                    BuyName      = Cvr.Info.Name,
                    BuyPhoto     = null,
                    BuyDate      = null,
                    ValidateType = 1,
                    SyncTime     = null,
                    Status       = 0,
                    Remark       = "",
                    UserName     = AftUserName,
                };

                AFT_System.Face.FaceFun.AddSessions(info);
            }
            catch (Exception ex)
            {
                ex.ToSaveLog("InSession");
            }
        }
예제 #4
0
        /// <summary> 读写IC卡 </summary>
        private int CheckICard()
        {
            FaceFun.TimeStart();
            var icInfo = new IdCardFunc.TicketCardInfo();
            int i      = IdCardFunc.GetTicketData_New(ref icInfo);

            if (i == 0)
            {
                if (IsIdSame && (Cvr.Info.Number != icInfo.IDCard))
                {
                    ShowEventMsg("身份证号码与票面不符合!", MsgType.Info);
                }
                else
                {
                    tempTime = DateTime.Now;
                    //检查白名单验证
                    if (!CheckWhite(icInfo.IDCard))
                    {
                        return(1);
                    }
                    //写入本地记录并且通知
                    var info = new SessionsInfo
                    {
                        SessionId    = MyMatch.SessionId,
                        CreateDate   = DateTime.Now,
                        Name         = MyMatch.SessionName,
                        IdNo         = icInfo.IDCard,
                        IdCardPhoto  = IrAdvanced.ReadBytesFromFile(FaceFun.BaseDir + "\\pic.bmp"),
                        TakePhoto    = PhotoOk,
                        FaceData     = FaceFun.StructToBytes(CameraRft),
                        IdAddress    = "",
                        TicketType   = 1,
                        TicketNo     = icInfo.CardNo,
                        Area         = icInfo.StadiumArea,
                        Row          = icInfo.Row,
                        Seat         = icInfo.Position,
                        TelNo        = IrAdvanced.ReadString("TelNo"),
                        TelArea      = IrAdvanced.ReadString("TelArea"),
                        BuyName      = icInfo.Name,
                        BuyPhoto     = null,
                        BuyDate      = null,
                        ValidateType = 2,
                        SyncTime     = null,
                        Status       = 0,
                        Remark       = "",
                        UserName     = AftUserName,
                    };
                    if (FaceFun.AddSessions(info) > 0)
                    {
                        Dispatcher.InvokeAsync(() =>
                        {
                            ShowEventMsg("检票成功", MsgType.FaceOk);
                            MyArea.Text = string.Format("区域:{0}{1}排{2}座", info.Area, info.Row, info.Seat);
                            MyNum.Text  = "票号:" + info.TicketNo;
                            MyType.Text = "类型:年票";
                            MyTime.Text = "时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                        });
                    }
                }
            }
            else if (i == 16)
            {
                i.ToString().ToSaveLog("已刷卡:");
                var str = (tempTime == null) ? "拒绝入场" : string.Format("{0}入场", tempTime);
                ShowEventMsg("一天只能入场一次!\n" + str, MsgType.InfoErr);
                ShowEventMsg("检票失败", MsgType.FaceErr);
                Thread.Sleep(500);
            }
            else if (i == 1)    //未放卡
            {
                tempTime = null;
            }
            else
            {
                i.ToString().ToSaveLog("IC卡读卡失败:");
                Thread.Sleep(300);
            }
            FaceFun.TimeStop("IC读写耗时:");
            return(i);
        }