示例#1
0
        public void RecvData(string recv)
        {
            if (recv.Contains("PNO") && recv.Contains("IP"))
            {
                DAL.DAL_Authorize _Authorizedao = new DAL.DAL_Authorize();
                DAL.DAL_Log       _logdal       = new DAL.DAL_Log();

                string No = recv.Substring(recv.IndexOf("NO") + 2, recv.IndexOf("IP") - recv.IndexOf("NO") - 2);

                string IP = recv.Substring(recv.IndexOf("IP") + 2, recv.Length - recv.IndexOf("IP") - 2);

                if (_Authorizedao.CheckPassengerWithDevice(No, IP))
                {
                    DAL.DAO.CustomerDao customerdao = (new DAL.DAL_CustomerInfo()).selectCustomerInfoWithCardNum(No);
                    DAL.DAO.DeviceDao   devcedao    = (new DAL.DAL_Device()).selectDeviceInfoWithIP(IP);
                    string positiondirection        = (new DAL.DAL_Position()).GetPositionDirection(devcedao.Deviceposition);
                    int    positionid = (new DAL.DAL_Position()).GetPositionID(devcedao.Deviceposition);

                    if (positiondirection == "0")
                    {
                        _logdal.Inster_Log(devcedao.Deviceposition + "位置进门", 0, positionid, No, (int)(DateTime.Now - DateTime.Parse("1970-1-1 00:00:00")).TotalSeconds, DateTime.Now, "卡号" + No + "的用户通过验证");
                        this.Invoke(new Action(() =>
                        {
                            peopleGetin(customerdao.Name, customerdao.Idcard);
                        }));
                    }
                    else if (positiondirection == "1")
                    {
                        _logdal.Inster_Log(devcedao.Deviceposition + "位置出门", 1, positionid, No, (int)(DateTime.Now - DateTime.Parse("1970-1-1 00:00:00")).TotalSeconds, DateTime.Now, "卡号" + No + "的用户通过验证");
                    }
                }
            }
        }
示例#2
0
        public void RecvData(string recv)
        {
            if (recv.Contains("VNO") && recv.Contains("IP"))
            {
                DAL.DAL_Authorize _Authorizedao = new DAL.DAL_Authorize();
                DAL.DAL_Log       _logdal       = new DAL.DAL_Log();

                string No = recv.Substring(recv.IndexOf("NO") + 2, recv.IndexOf("IP") - recv.IndexOf("NO") - 2);

                string IP = recv.Substring(recv.IndexOf("IP") + 2, recv.Length - recv.IndexOf("IP") - 2);



                if (_Authorizedao.CheckVehicleInfoWithDevice(No, "", IP))
                {
                    DAL.DAO.DeviceDao devcedao          = (new DAL.DAL_Device()).selectDeviceInfoWithIP(IP);
                    string            positiondirection = (new DAL.DAL_Position()).GetPositionDirection(devcedao.Deviceposition);
                    int positionid = (new DAL.DAL_Position()).GetPositionID(devcedao.Deviceposition);
                    if (positiondirection == "0")
                    {
                        _logdal.Inster_Log(devcedao.Deviceposition + "位置进车", 2, positionid, No, (int)(DateTime.Now - DateTime.Parse("1970-1-1 00:00:00")).TotalSeconds, DateTime.Now, "车牌" + No + "的车辆通过验证");
                    }
                    else if (positiondirection == "1")
                    {
                        _logdal.Inster_Log(devcedao.Deviceposition + "位置出车", 3, positionid, No, (int)(DateTime.Now - DateTime.Parse("1970-1-1 00:00:00")).TotalSeconds, DateTime.Now, "车牌" + No + "的车辆通过验证");
                        this.Invoke(new Action(() =>
                        {
                            VehicleOut(No);
                        }));
                    }
                }
                else
                {
                }
            }
        }