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 RunLogShow(string currentPage) { RunLogQueryStatement qs = new RunLogQueryStatement(); if (comboBox4.Text != "") { qs.Operation = comboBox8.Text; } if (comboBox10.Text != "") { qs.IsAbnormal = comboBox11.Text; } if (checkBox12.Checked) { qs.StartDate = dateTimePicker6.Text.ToString(); } if (checkBox10.Checked) { qs.StartTime = maskedTextBox6.Text.ToString(); } if (checkBox11.Checked) { qs.EndDate = dateTimePicker5.Text.ToString(); } if (checkBox9.Checked) { qs.EndTime = maskedTextBox5.Text.ToString(); } string errorInfo = ""; DataSet ds = RunLogClass.SelectRunLogInfo(currentPage, comboBox9.Text, qs, ref errorInfo); if (ds == null) { MessageBox.Show(errorInfo); } RunLogCount = RunLogClass.GetRunLogPageCount(qs, ref errorInfo); dataGridView4.DataSource = ds; dataGridView4.DataMember = "RunLog"; RunPageBtn.Text = currentPage; label23.Text = "当前页" + dataGridView4.Rows.Count + "条记录 / 共" + RunLogCount + "条记录"; }
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(); }