/// <summary> /// 历史操作信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void opreat_info_Layout() { //禁止datagridview自动创建列和行 this.dataGridView5.AutoGenerateColumns = false; queryByType.SelectedIndex = 0; List<Model.log> log_list = new Bll.log().GetModelList("LOG_TYPE = 1"); dataGridView5.DataSource = log_list; }
/// <summary> /// 按类型查看日志 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void queryByType_SelectedIndexChanged(object sender, EventArgs e) { if (queryByType.SelectedItem.ToString().Equals("全选")) { List<Model.log> log_list = new Bll.log().GetModelList("LOG_TYPE = 1"); dataGridView5.DataSource = log_list; } else { List<Model.log> log_list = new Bll.log().GetModelList("LOG_TYPE = 1 and LOG_DISCRIBE = '" + queryByType.SelectedItem.ToString() + "'"); dataGridView5.DataSource = log_list; } }
/// <summary> /// 按日期查询日志 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void end_ValueChanged(object sender, EventArgs e) { string start_time = start.Text; string end_time = end.Text; if (queryByType.SelectedItem.ToString().Equals("全选")) { List<Model.log> log_list = new Bll.log().GetModelList("LOG_TYPE = 1 and LOG_TIME between '" + start_time + "' and '" + end_time + "'"); dataGridView5.DataSource = log_list; } else { List<Model.log> log_list = new Bll.log().GetModelList("LOG_TYPE = 1 and LOG_TIME between '" + start_time + "' and '" + end_time + "' and LOG_DISCRIBE = '" + queryByType.SelectedItem.ToString() + "'"); dataGridView5.DataSource = log_list; } }