Пример #1
0
        List <string> DeviceIDs; //选中设备ID
        public InformationManagement()
        {
            InitializeComponent();
            DeviceIDs = new List <string>();

            Access.Connection();
            #region 录像管理初始化
            //获得记录总条数
            RecCount = RecFileClass.GetRecPageCount(new RecQueryStatement());
            DataSet r_ds = RecFileClass.SelectRecInfo("1", comboBox1.Text, new RecQueryStatement());
            dataGridView1.DataSource = r_ds;
            dataGridView1.DataMember = "RecFileList";
            label2.Text = "当前页" + dataGridView1.Rows.Count + "条记录/共" + RecCount + "条记录";
            //填充用户名
            List <string> r_usernames = RecFileClass.GetUserNames();
            comboBox3.DataSource = r_usernames;
            #endregion

            #region 图片管理初始化
            //获得记录总条数
            PicCount = RecPictureClass.GetPicPageCount(new PicQueryStatement());
            DataSet p_ds = RecPictureClass.SelectPictureInfo("1", comboBox6.Text, new PicQueryStatement());
            dataGridView2.DataSource = p_ds;
            dataGridView2.DataMember = "RecPictureList";
            label13.Text             = "当前页" + dataGridView2.Rows.Count + "条记录/共" + PicCount + "条记录";
            //填充用户名
            List <string> p_usernames = RecPictureClass.GetUserNames();
            comboBox5.DataSource = p_usernames;
            #endregion

            #region 用户日志初始化
            //获得记录总条数
            UserLogCount = UserLogClass.GetUserLogPageCount(new UserLogQueryStatement());
            DataSet u_ds = UserLogClass.SelectUserLogInfo("1", comboBox7.Text, new UserLogQueryStatement());
            dataGridView3.DataSource = u_ds;
            dataGridView3.DataMember = "UserLog";
            label17.Text             = "当前页" + dataGridView3.Rows.Count + "条记录/共" + UserLogCount + "条记录";
            //填充用户名
            List <string> u_usernames = UserLogClass.GetUserNames();
            comboBox4.DataSource = u_usernames;
            #endregion

            #region 运行日志初始化
            RunLogCount = RunLogClass.GetRunLogPageCount(new RunLogQueryStatement());
            DataSet run_ds = RunLogClass.SelectRunLogInfo("1", comboBox9.Text, new RunLogQueryStatement());
            dataGridView4.DataSource = run_ds;
            dataGridView4.DataMember = "RunLog";
            label23.Text             = "当前页" + dataGridView4.Rows.Count + "条记录/共" + RunLogCount + "条记录";
            //填充日志类型
            List <string> run_operation = RunLogClass.GetOperations();
            comboBox8.DataSource = run_operation;
            #endregion


            #region 添加设备节点
            Thread th = new Thread(new ThreadStart(Init));
            th.IsBackground = true;
            th.Start();
            #endregion
        }
Пример #2
0
        /// <summary>
        /// 查询录像信息
        /// </summary>
        public void RecShow(string currentPage)
        {
            RecQueryStatement qs = new RecQueryStatement();

            if (RecChannelName.Text != "")
            {
                qs.CameraID = DeviceIDs;
            }
            switch (comboBox2.Text)
            {
            case "手动录像":
                qs.RecType = "1";
                break;

            case "自动录像":
                qs.RecType = "2";
                break;

            case "报警录像":
                qs.RecType = "3";
                break;
            }
            if (comboBox3.Text != "")
            {
                qs.UserName = comboBox3.Text;
            }
            if (checkBox1.Checked)
            {
                qs.RecStartDate = page1_startDate.Text.ToString();
            }
            if (checkBox4.Checked)
            {
                qs.RecStartTime = page1_startTime.Text.ToString();
            }
            if (checkBox2.Checked)
            {
                qs.RecEndDate = page1_endDate.Text.ToString();
            }
            if (checkBox3.Checked)
            {
                qs.RecEndTime = page1_endTime.Text.ToString();
            }
            string errorInfo = "";

            RecCount = RecFileClass.GetRecPageCount(qs, ref errorInfo);
            if (RecCount == -1)
            {
                MessageBox.Show(errorInfo);
                return;
            }
            DataSet ds = RecFileClass.SelectRecInfo(currentPage, comboBox1.Text, qs, ref errorInfo);

            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "RecFileList";
            RecPageBtn.Text          = currentPage;
            label2.Text = "当前页" + dataGridView1.Rows.Count + "条记录 / 共" + RecCount + "条记录";
        }
Пример #3
0
        public InformationManagement()
        {
            InitializeComponent();
            DeviceIDs = new List <string>();
            #region 录像管理初始化
            //获得记录总条数
            RecCount = RecFileClass.GetRecPageCount(new RecQueryStatement(), ref errorInfo);
            DataSet r_ds = RecFileClass.SelectRecInfo("1", "10", new RecQueryStatement(), ref errorInfo);
            if (r_ds == null)
            {
                MessageBox.Show(errorInfo + ",获取录像管理信息失败!");
            }
            dataGridView1.DataSource = r_ds;
            dataGridView1.DataMember = "RecFileList";
            label2.Text = "当前页" + dataGridView1.Rows.Count + "条记录/共" + RecCount + "条记录";
            //填充用户名
            List <string> r_usernames = RecFileClass.GetUserNames(ref errorInfo);
            comboBox3.DataSource = r_usernames;
            #endregion

            #region 图片管理初始化
            //获得记录总条数
            PicCount = RecPictureClass.GetPicPageCount(new PicQueryStatement(), ref errorInfo);
            //if (PicCount == -1) MessageBox.Show(errorInfo);
            DataSet p_ds = RecPictureClass.SelectPictureInfo("1", "10", new PicQueryStatement(), ref errorInfo);
            if (p_ds == null)
            {
                MessageBox.Show(errorInfo + ",获取图片管理信息失败!");
            }
            dataGridView2.DataSource = p_ds;
            dataGridView2.DataMember = "RecPictureList";
            label13.Text             = "当前页" + dataGridView2.Rows.Count + "条记录/共" + PicCount + "条记录";
            //填充用户名
            List <string> p_usernames = RecPictureClass.GetUserNames(ref errorInfo);
            comboBox5.DataSource = p_usernames;
            #endregion

            #region 用户日志初始化
            //获得记录总条数
            UserLogCount = UserLogClass.GetUserLogPageCount(new UserLogQueryStatement(), ref errorInfo);
            DataSet u_ds = UserLogClass.SelectUserLogInfo("1", "10", new UserLogQueryStatement(), ref errorInfo);
            if (u_ds == null)
            {
                MessageBox.Show(errorInfo + ",获取用户日志信息失败!");
            }
            dataGridView3.DataSource = u_ds;
            dataGridView3.DataMember = "UserLog";
            label17.Text             = "当前页" + dataGridView3.Rows.Count + "条记录/共" + UserLogCount + "条记录";
            //填充用户名
            List <string> u_usernames = UserLogClass.GetUserNames(ref errorInfo);
            comboBox4.DataSource = u_usernames;
            //填充用户操作
            List <string> u_operation = UserLogClass.GetOperations(ref errorInfo);
            comboBox10.DataSource = u_operation;
            #endregion

            #region 运行日志初始化
            RunLogCount = RunLogClass.GetRunLogPageCount(new RunLogQueryStatement(), ref errorInfo);
            DataSet run_ds = RunLogClass.SelectRunLogInfo("1", "10", new RunLogQueryStatement(), ref errorInfo);
            if (run_ds == null)
            {
                MessageBox.Show(errorInfo + ",获取运行日志信息失败!");
            }
            dataGridView4.DataSource = run_ds;
            dataGridView4.DataMember = "RunLog";
            label23.Text             = "当前页" + dataGridView4.Rows.Count + "条记录/共" + RunLogCount + "条记录";
            //填充日志类型
            List <string> run_operation = RunLogClass.GetOperations(ref errorInfo);
            comboBox8.DataSource = run_operation;
            #endregion


            #region 添加设备节点
            Thread th = new Thread(new ThreadStart(Init));
            th.IsBackground = true;
            th.Start();
            #endregion
            treeView1.ExpandAll();
        }
Пример #4
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode tn = e.Node;

            if (tn.Level == 1)
            {
                switch (tn.Text)
                {
                case "录像管理":
                    tabControl1.SelectedIndex = 0;
                    RecCount = RecFileClass.GetRecPageCount(new RecQueryStatement(), ref errorInfo);
                    DataSet r_ds = RecFileClass.SelectRecInfo("1", "10", new RecQueryStatement(), ref errorInfo);
                    if (r_ds == null)
                    {
                        MessageBox.Show(errorInfo + ",获取录像管理信息失败!");
                    }
                    dataGridView1.DataSource = r_ds;
                    dataGridView1.DataMember = "RecFileList";
                    label2.Text = "当前页" + dataGridView1.Rows.Count + "条记录/共" + RecCount + "条记录";
                    break;

                case "图片管理":
                    tabControl1.SelectedIndex = 1;
                    PicCount = RecPictureClass.GetPicPageCount(new PicQueryStatement(), ref errorInfo);
                    DataSet p_ds = RecPictureClass.SelectPictureInfo("1", "10", new PicQueryStatement(), ref errorInfo);
                    if (p_ds == null)
                    {
                        MessageBox.Show(errorInfo + ",获取图片管理信息失败!");
                    }
                    dataGridView2.DataSource = p_ds;
                    dataGridView2.DataMember = "RecPictureList";
                    label13.Text             = "当前页" + dataGridView2.Rows.Count + "条记录/共" + PicCount + "条记录";
                    break;

                case "用户日志":
                    tabControl1.SelectedIndex = 2;
                    break;

                case "运行日志":
                    tabControl1.SelectedIndex = 3;
                    break;
                }
            }
            else if (tn.Level == 2)
            {
                switch (tn.Parent.Text)
                {
                case "录像管理":
                    tabControl1.SelectedIndex = 0;
                    RecChannelName.Text       = tn.Text;
                    DeviceIDs.Clear();
                    //查询DVR下的摄像机?怎么查?将DVR/NVR下的设备列表全都查一遍
                    for (int i = 0; i < tn.Nodes.Count; i++)
                    {
                        DeviceIDs.Add(tn.Nodes[i].Tag.ToString());
                    }
                    RecShow("1");
                    break;

                case "图片管理":
                    tabControl1.SelectedIndex = 1;
                    PicChannelName.Text       = tn.Text;
                    DeviceIDs.Clear();
                    for (int i = 0; i < tn.Nodes.Count; i++)
                    {
                        DeviceIDs.Add(tn.Nodes[i].Tag.ToString());
                    }
                    PictureShow("1");
                    break;

                case "用户日志":
                    tabControl1.SelectedIndex = 2;
                    break;

                case "运行日志":
                    tabControl1.SelectedIndex = 3;
                    break;
                }
            }
            else if (tn.Level == 3)
            {
                switch (tn.Parent.Parent.Text)
                {
                case "录像管理":
                    tabControl1.SelectedIndex = 0;
                    RecChannelName.Text       = tn.Text;
                    DeviceIDs.Clear();
                    DeviceIDs.Add(tn.Tag.ToString());
                    RecShow("1");
                    break;

                case "图片管理":
                    tabControl1.SelectedIndex = 1;
                    PicChannelName.Text       = tn.Text;
                    DeviceIDs.Clear();
                    DeviceIDs.Add(tn.Tag.ToString());
                    PictureShow("1");
                    break;
                }
            }
        }