示例#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 bool CheckInfoBeforeAdd()
        {
            if (!Regex.IsMatch(txb_VehicleNum.Text, @"^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$"))
            {
                MessageBox.Show("请填写正确的车牌号");
                return(false);
            }

            if (cmb_VehicleKind.Text == "")
            {
                MessageBox.Show("请选择车辆类型");
                return(false);
            }

            if (cmb_VehicleType.Text == "")
            {
                MessageBox.Show("请填写正确的车牌号");
                return(false);
            }

            if (cbx_IsNewCustomer.Checked == false && SelectUserGrid.SelectedRows.Count <= 0)
            {
                MessageBox.Show("请选择车辆的所属人员");
                return(false);
            }

            if (cbx_IsNewCustomer.Checked == true && !CheckInfo())
            {
                MessageBox.Show("新增人员信息填写不正确");
                return(false);
            }
            if (cbx_IsNewCustomer.Checked == true && txb_CustomerName.Text != "" && txb_IDCard.Text != "")
            {
                DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo();
                DAL.DAO.CustomerDao  customerdao = new DAL.DAO.CustomerDao();

                customerdao.Name   = this.txb_CustomerName.Text;
                customerdao.Sex    = this.cmb_CustomerSex.Text;
                customerdao.Nation = this.cmb_Nation.Text;
                if (cmb_CustomerType.SelectedIndex == 0)
                {
                    customerdao.Istemp = 0;
                }
                else
                {
                    customerdao.Istemp = 1;
                }
                customerdao.Idcard  = this.txb_IDCard.Text;
                customerdao.Address = this.txb_Address.Text;

                if (!customerdal.insertCustomerInfo(customerdao))
                {
                    MessageBox.Show("新增人员时出现错误!添加车辆失败");
                    return(false);
                }
                vehicle_ownerid = customerdal.GetCustomerIDWithIDCard(customerdao.Idcard);
            }
            return(true);
        }
示例#3
0
        private void CustomerAuthorize_Load(object sender, EventArgs e)
        {
            DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo();

            DAL.DAO.CustomerDao customerdao = customerdal.selectCustomerInfoID(customerid);

            this.lab_username.Text = customerdao.Name;

            this.lab_rfid.Text = customerdao.Rfid;

            GetCustomerGroup();

            LoadLanguage("");
        }
示例#4
0
        private void EditCustomerForm_Load(object sender, EventArgs e)
        {
            LoadLanguage("");

            this.cmb_Nation.Items.Clear();

            DAL.DAL_CustomerInfo userdal = new DAL.DAL_CustomerInfo();

            DataTable _dt = userdal.getNationTable();

            if (_dt.Rows.Count > 0)
            {
                foreach (DataRow _row in _dt.Rows)
                {
                    this.cmb_Nation.Items.Add(_row[1]);
                }
            }

            userdao = userdal.selectCustomerInfoID(customerid);

            if (userdao == null)
            {
                MessageBox.Show("获取用户信息失败!");
                this.Close();
            }
            else
            {
                this.combo_CustomerSex.Text = userdao.Sex;
                this.txb_CustomerName.Text  = userdao.Name;
                this.cmb_Nation.Text        = userdao.Nation;
                this.txb_Address.Text       = userdao.Address;
                this.txb_IDCard.Text        = userdao.Idcard;
                this.txb_Rfid.Text          = userdao.Rfid;
                this.txb_Remark.Text        = userdao.Remark;
                if (userdao.Istemp == 0)
                {
                    cmb_CustomerType.SelectedIndex = 0;
                }
                else
                {
                    cmb_CustomerType.SelectedIndex = 1;
                }
            }
        }
示例#5
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (!CheckInfo())
            {
                return;
            }

            DAL.DAO.CustomerDao customerdao = new DAL.DAO.CustomerDao();

            customerdao.Sex     = this.cmb_CustomerSex.Text;
            customerdao.Name    = this.txb_CustomerName.Text;
            customerdao.Nation  = this.cmb_Nation.Text;
            customerdao.Address = this.txb_Address.Text;
            customerdao.Idcard  = this.txb_IDCard.Text;
            customerdao.Rfid    = this.txb_Rfid.Text;
            customerdao.Remark  = this.txb_Remark.Text;
            if (cmb_CustomerType.SelectedIndex == 0)
            {
                customerdao.Istemp = 0;
            }
            else
            {
                customerdao.Istemp = 1;
            }

            DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo();

            if (customerdal.insertCustomerInfo(customerdao))
            {
                MessageBox.Show("添加人员成功");
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("添加人员失败");
            }
        }