/// <summary> /// 日期变更时,重新查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { _datatable = MapDBClass.GetProperty(_MapId, _LayerId, _Object.ID, comboBox1.Text.Trim()); if (_datatable == null) { return; } if (_datatable.Rows.Count > 0) { _UpdateDate = _datatable.Rows[0]["UpdateDate"].ToString(); } else { _UpdateDate = ""; } if (_datatable.Rows.Count == 0 && checkBox1.Checked) { if (_Selected) { return; } if (!_Selected && comboBox1.Items.Count > 0) { _datatable = MapDBClass.GetProperty(_MapId, _LayerId, _Object.ID, comboBox1.Items[comboBox1.Items.Count - 1].ToString()); } } dataGridView1.Rows.Clear(); dataGridView1.Columns[0].ReadOnly = true; for (int i = 4; i < _datatable.Columns.Count; i++) { string colname = _datatable.Columns[i].ColumnName; if (colname.ToLower() == "createdate" || colname.ToLower() == "updatedate") { continue; } int row = dataGridView1.Rows.Add(); dataGridView1.Rows[row].Cells[0].Value = colname; if (_datatable.Rows.Count > 0) { _Selected = true; dataGridView1.Rows[row].Cells[1].Value = _datatable.Rows[0][i]; } int findrow = FindDefineRow(colname); if (findrow >= 0) { dataGridView1.Rows[row].Cells[2].Value = _table.Rows[findrow]["DataType"]; dataGridView1.Rows[row].Cells[3].Value = _table.Rows[findrow]["AllowUnSelect"]; dataGridView1.Rows[row].Cells[4].Value = _table.Rows[findrow]["AllowInput"]; dataGridView1.Rows[row].Cells[5].Value = _table.Rows[findrow]["List"]; dataGridView1.Rows[row].Visible = _table.Rows[findrow]["AllowVisible"] != null && _table.Rows[findrow]["AllowVisible"].ToString() == "1"; } } }