diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index 8d915a9..3da1476 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDeepstatis(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); }else if (frm.WindowState == FormWindowState.Minimized) { frm.WindowState = FormWindowState.Normal; diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index 8d915a9..3da1476 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDeepstatis(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); }else if (frm.WindowState == FormWindowState.Minimized) { frm.WindowState = FormWindowState.Normal; diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index c09aaf1..e43ebac 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDiametergather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index 8d915a9..3da1476 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDeepstatis(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); }else if (frm.WindowState == FormWindowState.Minimized) { frm.WindowState = FormWindowState.Normal; diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index c09aaf1..e43ebac 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDiametergather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index 5ca8144..701927a 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmpipeMaterialGather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if(frm.WindowState == FormWindowState.Minimized) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index 8d915a9..3da1476 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDeepstatis(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); }else if (frm.WindowState == FormWindowState.Minimized) { frm.WindowState = FormWindowState.Normal; diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index c09aaf1..e43ebac 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDiametergather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index 5ca8144..701927a 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmpipeMaterialGather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if(frm.WindowState == FormWindowState.Minimized) { diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index 48ac35f..b90b551 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new Frmpipediameterstatis(_globeControl1, pipeLayers, visibleId); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/EMS_Forms/Form_EventManager.cs b/EMS_Forms/Form_EventManager.cs index 871f8f6..fcd6e6e 100644 --- a/EMS_Forms/Form_EventManager.cs +++ b/EMS_Forms/Form_EventManager.cs @@ -12,7 +12,7 @@ public partial class Form_EventManager : Office2007Form { private GSOGlobeControl globeControl1; -// DataTable dt = new DataTable(); + // DataTable dt = new DataTable(); OracleConnection conn; int maxPageIndex = 20; @@ -45,7 +45,7 @@ dateTimePicker_end.Value = DateTime.Now; dateTimePicker_start.Value = DateTime.Now.AddDays(-6); -// LoadData(); + // LoadData(); conn = OledbHelper.sqlConnection(); string com = "select * from PATROLER"; @@ -100,11 +100,11 @@ winGridViewPager1.AddColumnAlias("处理状态", "处理状态"); winGridViewPager1.DisplayColumns = "上报时间,事件描述,事件地点,上报人员,任务编号,处理结果,处理状态"; - + winGridViewPager1.BackColor = Color.LightCyan;//间隔颜色 //隐藏右键功能按钮 - + winGridViewPager1.dataGridView1.ContextMenuStrip.Items[3].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[4].Visible = false; winGridViewPager1.dataGridView1.ContextMenuStrip.Items[5].Visible = false; @@ -153,7 +153,7 @@ DataGridViewRow row = grid.SelectedRows[0]; try { - WindowState = FormWindowState.Minimized; + WindowState = FormWindowState.Minimized; globeControl1.Globe.MemoryLayer.RemoveAllFeature(); WindowState = FormWindowState.Minimized; double x = Convert.ToDouble(row.Cells["经度"].Value); @@ -229,7 +229,7 @@ { int dbId = Convert.ToInt32(row.Cells["编号"].Value); string result = Convert.ToString(row.Cells["处理结果"].Value); - + Form_EventResult form = new Form_EventResult(dbId, result); form.refresh += LoadData;//改变值的事件 form.ShowDialog(); @@ -284,7 +284,8 @@ { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "已处理"; } - else { + else + { winGridViewPager1.dataGridView1.Rows[i].Cells["处理状态"].Value = "未处理"; } @@ -300,14 +301,14 @@ if (compare == 1) { MessageBox.Show("起始时间不能大于终止时间,请重新设置!", "提示"); - return ; + return; } } string sqlData = GetSql(pageIndex); initlizeDatagrid(); DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, sqlData).Tables[0]; winGridViewPager1.DataSource = table.DefaultView; - + if (table.Rows.Count == 0) { MessageBox.Show("没有找到任何数据!", "提示"); @@ -331,12 +332,12 @@ { string sqlCount = "select count(*) from ACCIDENT where 1=1"; - string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述,"+ - "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员,"+ + string sqlData = "select ACCIDENTTIME as 上报时间,DBID as 编号,DESCRIBE as 事件描述," + + "LATITUDE as 纬度,LOCALE as 事件地点,LONGITUDE as 经度,PATROLERNAME 上报人员," + "PATROLER_ID as 人员ID,TASK_ID as 任务编号,RESULT as 处理结果,'' as 处理状态 " + "from (select t.*,rownum row_num from ACCIDENT t order by DBID)b " + " where 1=1"; - + rows = int.Parse(OracleUtils.ExecuteScalar(OracleUtils.ConnectionString, CommandType.Text, sqlCount).ToString()); return sqlData; @@ -344,8 +345,8 @@ private string GetSql(int pageIndex) { - int minPage = (pageIndex - 1)*maxPageIndex + 1; - int maxPage = pageIndex*maxPageIndex; + int minPage = (pageIndex - 1) * maxPageIndex + 1; + int maxPage = pageIndex * maxPageIndex; string sqlCount = "select count(*) from ACCIDENT where 1=1"; @@ -399,10 +400,10 @@ catch (Exception ex) { MessageBox.Show("查询失败:" + ex, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + } } - + } } diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index 18e2bb9..bc17a94 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -92,7 +92,7 @@ flyToTask(e.RowIndex); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/EMS_Forms/Form_TaskManager.cs b/EMS_Forms/Form_TaskManager.cs index 6c893c9..8544987 100644 --- a/EMS_Forms/Form_TaskManager.cs +++ b/EMS_Forms/Form_TaskManager.cs @@ -7,6 +7,7 @@ using GeoScene.Globe; using DevComponents.DotNetBar; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe.EMS_Forms { @@ -39,7 +40,7 @@ private void button_new_Click(object sender, EventArgs e) { Form_EditTask form = new Form_EditTask(globeControl1); - form.Show(); + form.ShowDialog(); Close(); } @@ -115,8 +116,8 @@ private void flyToTask(DataGridViewRow row, int taskState) { int dbID = 0; - dbID = Convert.ToInt32(row.Cells["任务编号"].Value); - string userName = Convert.ToString(row.Cells["任务执行人员"].Value); + dbID = Convert.ToInt32(row.Cells["任务编号"].Value); // 任务编号 + string userName = Convert.ToString(row.Cells["任务执行人员"].Value); // 任务执行人员名称 DateTime t = new DateTime(); try { @@ -124,13 +125,13 @@ List listIDs = new List(); conn = OledbHelper.sqlConnection(); conn.Open(); - OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); + OracleCommand cmd = new OracleCommand("select * from MARK_TASK where TASK_ID ='" + dbID + "'", conn); // 根据任务编号查询数据库 OracleDataReader dr = cmd.ExecuteReader(); string condition = ""; while (dr.Read()) { listID li = new listID(); - li.MarkId = Convert.ToString(dr["MARK_ID"]); + li.MarkId = Convert.ToString(dr["MARK_ID"]); // 标识器编号 condition += "'"+li.MarkId+"',"; if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) { @@ -146,7 +147,7 @@ conn.Close(); conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); + cmd = new OracleCommand("select * from 标识器 where 编号 in("+condition.Substring(0,condition.Length-1)+")", conn); // 根据标识器编号在标识器表中查找 dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +ellps=krass +units=m +no_defs"); @@ -174,19 +175,20 @@ GSOFeature flagFeature = globeControl1.Globe.Layers.GetLayerByCaption("标识器").GetFeatureByID(int.Parse(Convert.ToString(dr["LSSYS_ID"]))); model = flagFeature.Geometry as GSOGeoModel; - if (Convert.ToInt16(listIDs[i].check) == 1) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; - model.FilePath = filepath; - } - if (Convert.ToInt16(listIDs[i].check) == 0) - { - filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; - model.FilePath = filepath; - } + // 如果开放以下语句,标识器的模型会被小旗子覆盖掉 + //if (Convert.ToInt16(listIDs[i].check) == 1) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + //model.FilePath = filepath; + //} + //if (Convert.ToInt16(listIDs[i].check) == 0) + //{ + //filepath = Application.StartupPath + "/EMSgcm/小旗子/hongqi/hongqi.gcm"; + //filepath = Application.StartupPath + "/平台模型库gcm/小旗子/hongqi/hongqi.gcm"; + //model.FilePath = filepath; + //} - GSOFeature f = new GSOFeature(); f.Geometry = model; @@ -240,7 +242,6 @@ model = new GSOGeoModel(); filepath = Application.StartupPath + "/EMSgcm/hat/hat.gcm"; - model.FilePath = filepath; model.Position = po; model.AltitudeMode = EnumAltitudeMode.Absolute; @@ -432,15 +433,24 @@ void pager1_OnEndExport(object sender, EventArgs e) { - + Debug.WriteLine("pager1_OnEndExport"); } void pager1_OnStartExport(object sender, EventArgs e) { - int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; - string where = GetSql(); - DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; - winGridViewPager1.AllToExport = table; + try { + Debug.WriteLine("pager1_OnEndExport"); + int pageIndex = winGridViewPager1.PagerInfo.CurrenetPageIndex; + string where = GetSql(); + DataTable table = OracleUtils.ExecuteDataset(OracleUtils.ConnectionString, CommandType.Text, where).Tables[0]; + Debug.WriteLine(table.Rows.Count); + winGridViewPager1.AllToExport = table; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } /// @@ -484,7 +494,7 @@ flyToTask(row, taskStateInt); Form_TaskInfo p = new Form_TaskInfo(globeControl1, taskInfoDt); p.showParentForm += new Form_TaskInfo.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FormDocumentManager.cs b/FormDocumentManager.cs index 8847a72..30bb201 100644 --- a/FormDocumentManager.cs +++ b/FormDocumentManager.cs @@ -49,7 +49,7 @@ { frm = new FormDocumentManager(); //frm.waitpicBox.Show(); - frm.Show(); + frm.ShowDialog(); } else diff --git a/FrmAccessoriesgather.cs b/FrmAccessoriesgather.cs index c36273b..9cffe2a 100644 --- a/FrmAccessoriesgather.cs +++ b/FrmAccessoriesgather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmAccessoriesgather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else { diff --git a/FrmAddFlagBatch.cs b/FrmAddFlagBatch.cs index d643245..9d7f0a5 100644 --- a/FrmAddFlagBatch.cs +++ b/FrmAddFlagBatch.cs @@ -53,7 +53,7 @@ combo_model_name.Items.Clear(); globeControl1.Globe.Layers.Remove(layer); FrmValiDataShowErrorMessage showErrorMessage = new FrmValiDataShowErrorMessage(dlg.FileName, txtMessage); - showErrorMessage.Show(); + showErrorMessage.ShowDialog(); return; } else diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs index e9a4ae7..298cd0e 100644 --- a/FrmAllPipelineStatis.cs +++ b/FrmAllPipelineStatis.cs @@ -30,7 +30,7 @@ if (frm == null) { frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames,pageControl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { @@ -156,7 +156,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// /// 得到某图层区域内管线的map以及区域内管线长度的map diff --git a/FrmAllWorkWellStatis.cs b/FrmAllWorkWellStatis.cs index f253369..b8a3a4d 100644 --- a/FrmAllWorkWellStatis.cs +++ b/FrmAllWorkWellStatis.cs @@ -183,7 +183,7 @@ private void 导出统计专题图ToolStripMenuItem_Click(object sender, EventArgs e) { F_PATMTitle frm = new F_PATMTitle("S", chartAllAreaPipeline); - frm.Show(); + frm.ShowDialog(); } /// diff --git a/FrmBSQStatis.cs b/FrmBSQStatis.cs index 2a56de9..304de1e 100644 --- a/FrmBSQStatis.cs +++ b/FrmBSQStatis.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.OracleClient; +using System.Diagnostics; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; using DevComponents.DotNetBar; @@ -17,6 +18,7 @@ public FrmBSQStatis(GSOGlobeControl globeControl1,GSOGeoPolygon3D polygon) { + Debug.WriteLine("FrmBSQStatis"); this.globeControl1 = globeControl1; this.polygon = polygon; this.Text = this.polygon!=null ? "标识器绘制区域统计" : "标识器全区域统计"; @@ -55,7 +57,7 @@ private Dictionary getBSQNameAndNumMap(GSOGeoPolygon3D polygon) { - + Debug.WriteLine("getBSQNameAndNumMap"); Dictionary result = new Dictionary(); Dictionary codeAndType = new Dictionary(); //得到type的种类 @@ -109,6 +111,7 @@ { GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption("标识器"); GSOFeatures bsqFs = FeatureStatisticsService.GetLayerFeatures(polygon, layer); + Debug.WriteLine(bsqFs.Length); if (bsqFs == null || bsqFs.Length <= 0) { LogHelper.Error("标识器图层下的Feature为空!"); return null; diff --git a/FrmBasicQuery.cs b/FrmBasicQuery.cs index 3fe748e..52deb5c 100644 --- a/FrmBasicQuery.cs +++ b/FrmBasicQuery.cs @@ -32,7 +32,7 @@ if (frm == null) { frm = new FrmBasicQuery(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCodingQuery.cs b/FrmCodingQuery.cs index 9987842..d493116 100644 --- a/FrmCodingQuery.cs +++ b/FrmCodingQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmCodingQuery(_ctl, _list, mInitDataGridViewX1, pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmCompareFeature.cs b/FrmCompareFeature.cs index 0a5d0b0..4ef7e94 100644 --- a/FrmCompareFeature.cs +++ b/FrmCompareFeature.cs @@ -21,7 +21,7 @@ { frm = new FrmCompareFeature(_globeControl1, _globeControl2); frm.Location = new Point((width - frm.Width)/2, 50); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else { diff --git a/FrmDiameterQuery.cs b/FrmDiameterQuery.cs index 6595ee9..396c8c1 100644 --- a/FrmDiameterQuery.cs +++ b/FrmDiameterQuery.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmDiameterQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmEquipmentManage.cs b/FrmEquipmentManage.cs index 72b9184..dabc0e3 100644 --- a/FrmEquipmentManage.cs +++ b/FrmEquipmentManage.cs @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using DevComponents.DotNetBar; @@ -129,6 +130,7 @@ /// private void winGridViewPager1_OnEditSelected(object sender, EventArgs e) { + Debug.WriteLine("探测仪编辑"); if (Utility.isNeedLogin && !Utility.userRole.Contains("探测仪编辑")) return; DataGridView grid = sender as DataGridView; @@ -176,7 +178,7 @@ } String macId = row.Cells["MAC地址"].Value.ToString(); FrmLog frm = new FrmLog(macId); - frm.Show(); + frm.ShowDialog(); } catch (Exception ex) { diff --git a/FrmFittingQuery.cs b/FrmFittingQuery.cs index 3063dab..ae8baa7 100644 --- a/FrmFittingQuery.cs +++ b/FrmFittingQuery.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmFittingQuery(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmFlagManagers.cs b/FrmFlagManagers.cs index 09993fa..1e9d921 100644 --- a/FrmFlagManagers.cs +++ b/FrmFlagManagers.cs @@ -379,7 +379,7 @@ if (null != globeControl1) { FrmAddSinMark frm = new FrmAddSinMark(globeControl1); - frm.Show(); + frm.ShowDialog(); } } @@ -394,7 +394,7 @@ string id = row.Cells["编号"].Value.ToString(); FrmFlagDetail p = new FrmFlagDetail(globeControl1, id); p.showParentForm += new FrmFlagDetail.Handle(showThisForm);//改变值的事件 - p.Show(); + p.ShowDialog(); } catch (Exception ex) { diff --git a/FrmGBJC.cs b/FrmGBJC.cs index 9f47038..80cfb53 100644 --- a/FrmGBJC.cs +++ b/FrmGBJC.cs @@ -120,7 +120,7 @@ comboBoxRoad.SelectedItem.ToString(), globeControl1, globeControl2); FrmGBJCresult rs = new FrmGBJCresult(globeControl1, globeControl2, dt); - rs.Show(); + rs.ShowDialog(); this.Close(); } diff --git a/FrmKeywordQuery.cs b/FrmKeywordQuery.cs index ede0a93..b5664eb 100644 --- a/FrmKeywordQuery.cs +++ b/FrmKeywordQuery.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmKeywordQuery(_ctl, _list, InitDataGridViewX1); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmMaterialSel.cs b/FrmMaterialSel.cs index f658a8b..c76c583 100644 --- a/FrmMaterialSel.cs +++ b/FrmMaterialSel.cs @@ -22,7 +22,7 @@ if (frm == null) { frm = new FrmMaterialSel(_ctl, _list, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmPatrolerManager.cs b/FrmPatrolerManager.cs index 308032c..faf5f8c 100644 --- a/FrmPatrolerManager.cs +++ b/FrmPatrolerManager.cs @@ -252,7 +252,7 @@ { long dbid = long.Parse(row.Cells["编号"].Value.ToString()); PatrolLog p = new PatrolLog(dbid.ToString()); - p.Show(); + p.ShowDialog(); } catch (Exception ex) { @@ -282,7 +282,7 @@ if (dt.Rows.Count > 0) { TaskInfo p = new TaskInfo(int.Parse(dt.Rows[0][0].ToString())); - p.Show(); + p.ShowDialog(); } else { diff --git a/FrmQuerySQL.cs b/FrmQuerySQL.cs index 8dd23df..a31e7ce 100644 --- a/FrmQuerySQL.cs +++ b/FrmQuerySQL.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new FrmQuerySQL(_ctl, InitDataGridViewX1,pageControl); - frm.Show(_ctl.Parent); + frm.ShowDialog(_ctl.Parent); } else { diff --git a/FrmSetFlytoPos.cs b/FrmSetFlytoPos.cs index 8f753df..a234459 100644 --- a/FrmSetFlytoPos.cs +++ b/FrmSetFlytoPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetFlytoPos(globecontrol); - frm.Show(globecontrol.Parent); + frm.ShowDialog(globecontrol.Parent); } else { diff --git a/FrmSetLatLonPos.cs b/FrmSetLatLonPos.cs index 0f0584e..b2a611e 100644 --- a/FrmSetLatLonPos.cs +++ b/FrmSetLatLonPos.cs @@ -16,7 +16,7 @@ if (frm == null) { frm = new FrmSetLatLonPos(ctl); - frm.Show(ctl.Parent); + frm.ShowDialog(ctl.Parent); } else { diff --git a/FrmValveStatistics.cs b/FrmValveStatistics.cs index b6ede1c..7fe3840 100644 --- a/FrmValveStatistics.cs +++ b/FrmValveStatistics.cs @@ -169,7 +169,7 @@ { F_PATMTitle frm = new F_PATMTitle("S", chaFamenStatis); - frm.Show(); + frm.ShowDialog(); } /// /// 获取区域内的各图层阀门 diff --git a/FrmpipeDeepstatis.cs b/FrmpipeDeepstatis.cs index 8d915a9..3da1476 100644 --- a/FrmpipeDeepstatis.cs +++ b/FrmpipeDeepstatis.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDeepstatis(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); }else if (frm.WindowState == FormWindowState.Minimized) { frm.WindowState = FormWindowState.Normal; diff --git a/FrmpipeDiametergather.cs b/FrmpipeDiametergather.cs index c09aaf1..e43ebac 100644 --- a/FrmpipeDiametergather.cs +++ b/FrmpipeDiametergather.cs @@ -25,7 +25,7 @@ if (frm == null) { frm = new FrmpipeDiametergather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/FrmpipeMaterialGather.cs b/FrmpipeMaterialGather.cs index 5ca8144..701927a 100644 --- a/FrmpipeMaterialGather.cs +++ b/FrmpipeMaterialGather.cs @@ -23,7 +23,7 @@ if (frm == null) { frm = new FrmpipeMaterialGather(globeControl, pipeLayers, visibleId); - frm.Show(globeControl.Parent); + frm.ShowDialog(globeControl.Parent); } else if(frm.WindowState == FormWindowState.Minimized) { diff --git a/Frmpipediameterstatis.cs b/Frmpipediameterstatis.cs index 48ac35f..b90b551 100644 --- a/Frmpipediameterstatis.cs +++ b/Frmpipediameterstatis.cs @@ -24,7 +24,7 @@ if (frm == null) { frm = new Frmpipediameterstatis(_globeControl1, pipeLayers, visibleId); - frm.Show(_globeControl1.Parent); + frm.ShowDialog(_globeControl1.Parent); } else if (frm.WindowState == FormWindowState.Minimized) { diff --git a/NewFunction/FrmEditShapeFile.cs b/NewFunction/FrmEditShapeFile.cs index 42f0bf5..2e88332 100644 --- a/NewFunction/FrmEditShapeFile.cs +++ b/NewFunction/FrmEditShapeFile.cs @@ -154,13 +154,13 @@ private void 添加字段ToolStripMenuItem_Click(object sender, EventArgs e) { FrmEditShapeFile_AddField frm = new FrmEditShapeFile_AddField(geoLayer, dataGridView1); - frm.Show(this); + frm.ShowDialog(this); } private void 删除字段ToolStripMenuItem_Click(object sender, EventArgs e) { FrmEditShapeFile_DeleteField frm = new FrmEditShapeFile_DeleteField(geoLayer, dataGridView1); - frm.Show(this); + frm.ShowDialog(this); } private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)