public override void Update() { if (Tag is TX_Point) { TX_Point pt = Tag as TX_Point; pt.x = this.Position.Lng.ToString(); pt.y = this.Position.Lat.ToString(); pt.Text = this.Text; TX_PointHelper.Update(pt); } else if (Tag is string) { TX_Point pt = new TX_Point(); pt.x = this.Position.Lng.ToString(); pt.y = this.Position.Lat.ToString(); pt.Text = this.Text; pt.Type = "byqobject"; pt.LayerID = this.Overlay.Id; pt.ID = Tag.ToString(); TX_PointHelper.Create(pt); this.Tag = pt; } }
internal static void Create(TX_Point pt) { try { Client.ClientHelper.PlatformSqlMap.Create<TX_Point>(pt); } catch (Exception err) { //MessageBox.Show(err.Message); if (err.Message.IndexOf("FOREIGN") > 0) { TX_Project pro = new TX_Project(); pro.ProID = "0"; pro.ProjectName = "地理接线图"; try { Client.ClientHelper.PlatformSqlMap.Create<TX_Project>(pro); } catch { } TX_Layer lay = new TX_Layer(); lay.LayerID = pt.LayerID; lay.ProID = "0"; //try { Client.ClientHelper.PlatformSqlMap.Create<TX_Layer>(lay); Client.ClientHelper.PlatformSqlMap.Create<TX_Point>(pt); //} catch { } } } }
internal static void Update(TX_Point pt) { Client.ClientHelper.PlatformSqlMap.Update<TX_Point>(pt); }