diff --git a/EMS_Forms/Form_OnlineTask.cs b/EMS_Forms/Form_OnlineTask.cs index bf52702..18e2bb9 100644 --- a/EMS_Forms/Form_OnlineTask.cs +++ b/EMS_Forms/Form_OnlineTask.cs @@ -16,7 +16,7 @@ // DataTable dt = new DataTable(); private int currentpage = 1; private int lastpage = 1; - private int pagesize = 11; + private int pagesize = 10; public static bool IS_OPEN = false; @@ -122,7 +122,7 @@ listID li = new listID(); li.MarkId = Convert.ToString(dr["MARK_ID"]); - if (Convert.ToInt32(dr["IS_CHECKED"]) == 1) + if (DBNull.Value.Equals(dr["IS_CHECKED"]) == false && Convert.ToInt32(dr["IS_CHECKED"]) == 1) { //Datatime li.check = Convert.ToInt32(dr["IS_CHECKED"]); @@ -134,9 +134,18 @@ } dr.Close(); conn.Close(); + + string listIdsStr = ""; + for (int i = 0; i < listIDs.Count; i++) + { + listIdsStr += "'" + listIDs[i].MarkId + "',"; + } + listIdsStr = listIdsStr.Substring(0, listIdsStr.Length - 1); + conn = OledbHelper.sqlConnection(); conn.Open(); - cmd = new OracleCommand("select * from 标识器", conn); + Console.WriteLine("select * from 标识器 where 编号 in (" + listIdsStr + ")"); + cmd = new OracleCommand("select * from 标识器 where 编号 in (" + listIdsStr + ")", conn); dr = cmd.ExecuteReader(); int ID = GSOProjectManager.AddProject("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=499885 +y_0=6 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); @@ -168,12 +177,12 @@ p.Z = 1.5; if (Convert.ToInt16(listIDs[i].check) == 1) { - filepath = Application.StartupPath + "/EMSgcm/小旗子/lvqi/lvqi.gcm"; + filepath = Application.StartupPath + "/平台模型库gcm/小旗子/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; } @@ -182,7 +191,7 @@ model.AltitudeMode = EnumAltitudeMode.Absolute; GSOFeature f = new GSOFeature(); f.Geometry = model; - f.Name = "标识器:"+id; + f.Name = "标识器:" + id; GSOFeature newFeature = globeControl1.Globe.MemoryLayer.AddFeature(f); GSOLabel label = new GSOLabel(); label.Text = "任务工单号:" + dbID + "\r\n" + @@ -203,7 +212,7 @@ } dr.Close(); conn.Close(); - + /* //获取定位人员位置 conn = OledbHelper.sqlConnection(); conn.Open(); @@ -247,7 +256,7 @@ label1.Style.TextStyle.FontName = "黑体"; label1.Style.TractionLineEndPos = new GSOPoint2d(80, 60); newFeature1.Label = label1; - + // 按扫描时间对任务点进行排序 int m = 0; long time = 0; @@ -306,10 +315,10 @@ f2.SetFieldValue("description", "这是线的属性"); //设置几何对象的字段值 GSOFeature newFeature2 = globeControl1.Globe.MemoryLayer.AddFeature(f2); } - - EnumAltitudeMode altmode = EnumAltitudeMode.Absolute; - globeControl1.Globe.FlyToPointSpeed = 10000000; - globeControl1.Globe.FlyToPosition(po, altmode); + */ + //EnumAltitudeMode altmode = EnumAltitudeMode.Absolute; + //globeControl1.Globe.FlyToPointSpeed = 10000000; + //globeControl1.Globe.FlyToPosition(po, altmode); globeControl1.Refresh(); } @@ -378,9 +387,21 @@ for (int i = 1; i <= pages; i++) { combo_page_num.Items.Add(new ComboBoxItem(i.ToString(), i.ToString())); + + if (i == currentpage) + { + combo_page_num.SelectedIndex = i - 1; + } } - if (currentpage == 1) + if (lastpage == 1) + { + btn_page_first.Enabled = false; + btn_page_pre.Enabled = false; + btn_page_last.Enabled = false; + btn_page_next.Enabled = false; + } + else if (currentpage == 1) { btn_page_first.Enabled = false; btn_page_pre.Enabled = false; @@ -441,6 +462,11 @@ private void combo_page_num_Click(object sender, EventArgs e) { + if (currentpage == int.Parse(combo_page_num.Text)) + { + return; + } + if (!String.IsNullOrEmpty(combo_page_num.Text)) { currentpage = int.Parse(combo_page_num.Text);