Ejemplo n.º 1
0
        private void NewDeviceForm_Load(object sender, EventArgs e)
        {
            LoadLanguage("");

            this.txb_addr_part1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);


            DAL.DAL_Device   devicedal   = new DAL.DAL_Device();
            DAL.DAL_Position positiondal = new DAL.DAL_Position();

            DataTable _dt = devicedal.GetDeviceTypeList();

            if (_dt != null)
            {
                cmb_DeviceType.Items.Clear();

                foreach (DataRow _row in _dt.Rows)
                {
                    cmb_DeviceType.Items.Add(_row[0]);
                }
            }
            _dt = positiondal.selectPositionListInfo("");
            if (_dt != null)
            {
                cmb_DevicePosition.Items.Clear();

                foreach (DataRow _row in _dt.Rows)
                {
                    cmb_DevicePosition.Items.Add(_row[1]);
                }
            }
        }
Ejemplo n.º 2
0
        private void EditDeviceForm_Load(object sender, EventArgs e)
        {
            LoadLanguage("");

            this.txb_addr_part1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);
            this.txb_addr_part4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress);

            DAL.DAL_Device devicedal = new DAL.DAL_Device();

            DAL.DAO.DeviceDao devicedao = devicedal.selectDeviceInfoWithID(deviceid);

            if (devicedao == null)
            {
                MessageBox.Show("获取设备信息失败!");
                this.Close();
            }
            else
            {
                this.txb_DeviceName.Text = devicedao.Devicename;
                this.txb_DeviceCode.Text = devicedao.Code;

                string[] address = devicedao.Netaddress.Split('.');

                this.txb_addr_part1.Text = address[0];
                this.txb_addr_part2.Text = address[1];
                this.txb_addr_part3.Text = address[2];
                this.txb_addr_part4.Text = address[3];

                this.cmb_DevicePosition.Text = devicedao.Deviceposition;
            }
            DAL.DAL_Position positiondal = new DAL.DAL_Position();

            //DataTable _dt = devicedal.GetDeviceTypeList();
            //if (_dt != null)
            //{
            //    cmb_DeviceType.Items.Clear();

            //    foreach (DataRow _row in _dt.Rows)
            //    {
            //        cmb_DeviceType.Items.Add(_row[0]);
            //    }

            //}
            DataTable _dt = positiondal.selectPositionListInfo("");

            if (_dt != null)
            {
                cmb_DevicePosition.Items.Clear();

                foreach (DataRow _row in _dt.Rows)
                {
                    cmb_DevicePosition.Items.Add(_row[1]);
                }
            }
        }
Ejemplo n.º 3
0
        private void Device_ControlItem_View_AfterSelect(object sender, TreeViewEventArgs e)
        {
            int i    = 0;
            var tree = (TreeView)sender;

            this.tabControl2.Visible = true;

            if (tree.SelectedNode.Text == "出入记录")
            {
                tabControl2.SelectedIndex = 1;
                PositionCmb_Init();
            }

            if (tree.SelectedNode.Text == "出入口管理")
            {
                tabControl2.SelectedIndex = 2;
                DoorPositionTreeView_Init();
            }
            if (tree.SelectedNode.Text == "硬件配置")
            {
                //容器

                tabControl2.SelectedIndex = 0;

                {
                    DAL.DAL_Position positiondal = new DAL.DAL_Position();

                    DataTable _dt = positiondal.selectPositionListInfo("");

                    if (_dt.Rows.Count > 0)
                    {
                        this.cmb_DevicePosition.Items.Clear();
                        this.cmb_DevicePosition.Items.Add("全部");
                        this.cmb_DevicePosition.SelectedIndex = 0;

                        foreach (DataRow _row in _dt.Rows)
                        {
                            this.cmb_DevicePosition.Items.Add(_row[1]);
                        }
                    }
                }
            }
            else if (tree.SelectedNode.Text == "部门权限")
            {
                //DeviceOption_panel.Controls.Clear();
                //DeviceOptionControl devicecontrol = new DeviceOptionControl();
                //DeviceOption_panel.Controls.Add(devicecontrol);
                //devicecontrol.Show();
            }
            else if (tree.SelectedNode.Text == "统计汇总")
            {
                tabControl2.SelectedIndex = 3;
            }
        }
Ejemplo n.º 4
0
        private void DoorPositionTreeView_Init()
        {
            this.DoorPositionInfoTree.Nodes[0].Nodes[0].Nodes.Clear();

            DAL.DAL_Position positiondal = new DAL.DAL_Position();

            DataTable _dt = positiondal.selectPositionListInfo("1");

            if (_dt.Rows.Count > 0)
            {
                foreach (DataRow _row in _dt.Rows)
                {
                    TreeNode _node = new TreeNode();
                    _node.Name = _row[0].ToString();
                    _node.Text = _row[1].ToString();
                    this.DoorPositionInfoTree.Nodes[0].Nodes[0].Nodes.Add(_node);
                }
            }
        }
Ejemplo n.º 5
0
        private void PositionCmb_Init()
        {
            this.cmb_PassengerPosition.Items.Clear();

            this.cmb_PassengerPosition.Items.Add("全部");

            this.cmb_PassengerPosition.SelectedIndex = 0;

            DAL.DAL_Position positiondal = new DAL.DAL_Position();

            DataTable _dt = positiondal.selectPositionListInfo("1");

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

            this.cmb_VehiclePosition.Items.Clear();

            this.cmb_VehiclePosition.Items.Add("全部");

            this.cmb_VehiclePosition.SelectedIndex = 0;

            positiondal = new DAL.DAL_Position();

            _dt = positiondal.selectPositionListInfo("2");

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