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 }
/// <summary> /// 查询图片信息 /// </summary> public void PictureShow(string currentPage) { string errorInfo = ""; PicQueryStatement qs = new PicQueryStatement(); if (RecChannelName.Text != "") { qs.CameraID = DeviceIDs; } if (comboBox5.Text != "") { qs.UserName = comboBox3.Text; } if (checkBox8.Checked) { qs.RecStartDate = dateTimePicker2.Text.ToString(); } if (checkBox6.Checked) { qs.RecStartTime = maskedTextBox2.Text.ToString(); } if (checkBox7.Checked) { qs.RecEndDate = dateTimePicker1.Text.ToString(); } if (checkBox5.Checked) { qs.RecEndTime = maskedTextBox1.Text.ToString(); } DataSet ds = RecPictureClass.SelectPictureInfo(currentPage, comboBox6.Text, qs, ref errorInfo); if (ds == null) { MessageBox.Show(errorInfo); } PicCount = RecPictureClass.GetPicPageCount(qs, ref errorInfo); dataGridView2.DataSource = ds; dataGridView2.DataMember = "RecPictureList"; PicPageBtn.Text = currentPage; label13.Text = "当前页" + dataGridView2.Rows.Count + "条记录 / 共" + RecCount + "条记录"; }
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(); }
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; } } }
public void TestMethod2() { //Access.Connection(); List <string> usernames1 = RecPictureClass.GetUserNames(); //List<string> usernames2 = RecFileClass.GetUserNames(); }