示例#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
        //查询车辆出入记录
        private void button2_Click(object sender, EventArgs e)
        {
            DAL.DAL_Log _log = new DAL.DAL_Log();

            string eventposition = "";

            if (cmb_VehiclePosition.Text != "全部")
            {
                eventposition = cmb_VehiclePosition.Text;
            }

            DataTable dt = _log.search_vehicleLog(eventposition, VehicleRecordStartTime.Value.ToString(), VehicleRecordEndTime.Value.ToString(), this.txb_SearchPassKey.Text);

            if (dt != null)
            {
                VehicleRecordGrid.DataSource = dt;
            }
        }
示例#3
0
        //查询人员出入记录
        private void btn_RecordSearch_Click(object sender, EventArgs e)
        {
            DAL.DAL_Log _log = new DAL.DAL_Log();

            string eventposition = "";

            if (cmb_PassengerPosition.Text != "全部")
            {
                eventposition = cmb_PassengerPosition.Text;
            }

            DataTable dt = _log.search_PassengerLog(eventposition, PassRecordStartTime.Value.ToString(), PassRecordEndTime.Value.ToString(), txb_SearchPassKey.Text);

            if (dt != null)
            {
                PassengerRecordGrid.DataSource = dt;
            }
        }
示例#4
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
                {
                }
            }
        }