public Form2(MapFormParams leo, int StationId, bool sqlsrv = false) : this() { GlobIn = leo; GlobLat = GlobIn.latitude; GlobLon = GlobIn.longitude; numericUpDown1.Value = GlobIn.radius; numericUpDown2.Value = (int)gMap.Zoom; numericUpDown2.Minimum = gMap.MinZoom; numericUpDown2.Maximum = gMap.MaxZoom; if (sqlsrv) { SqlServerConnection = true; ShowDataToGridSQLSrv(dataGridView1, NonDispFields); FilterStaId(StationId); SetMarkers2All(); //GlobalDVCompany = PopulateDataView(NonDispFieldsCompany); GlobalDVCompany = PopulateSQLDataView(NonDispFieldsCompany); } else { ShowDataToGrid(dataGridView1, NonDispFields); FilterStaId(StationId); SetMarkers2All(); GlobalDVCompany = PopulateDataView(NonDispFieldsCompany); } }
private void button1_Click(object sender, EventArgs e) { MapFormParams LeoPass = new MapFormParams(); //LeoPass.longitude = 37.9641; //LeoPass.latitude = 23.5660; double LeoPasslongitude, LeoPasslatitude; int Leoradius; double.TryParse(textBox2.Text.ToString().Trim(), out LeoPasslongitude); double.TryParse(textBox1.Text.ToString().Trim(), out LeoPasslatitude); int.TryParse(textBox3.Text.ToString().Trim(), out Leoradius); LeoPass.longitude = LeoPasslongitude; LeoPass.latitude = LeoPasslatitude; LeoPass.radius = Leoradius; LeoPass.apiKey = "AIzaSyCxAKDi4ZgokHWCYK_5sQ8Dg-nlcLT2myo"; //string dbFilePath = "StationGeoData.db"; //SQLiteConnectionStringBuilder aaa = new SQLiteConnectionStringBuilder(); //aaa.DataSource = dbFilePath; //LeoPass.connectionString = aaa.ConnectionString; LeoPass.connectionString = "Data Source=StationGeoData.db"; //string dbFile = Application.StartupPath + "\\DBs\\StationGeoData.db"; //string myconnectionString = "Data Source=" + dbFile + ";Version=3;"; //LeoPass.connectionString = myconnectionString; //StationInterop Leo = new StationInterop(); //Maps.Form2 tex = new Maps.Form2(23.5660, 37.9641, 500, Leo); // Old using Interop Maps.Form2 tex = new Maps.Form2(37.9561, 23.6890, 10, Leo); Maps.Form2 tex = new Maps.Form2(LeoPass); tex.ShowDialog(); //tex.GleoPass.address MessageBox.Show(tex.GleoPass.address + " " + tex.GleoPass.name + " " + tex.GleoPass.brand_id.ToString() + " " + tex.GleoPass.id.ToString()); }
public static MapFormParams Create(UIFormLogic uIForm, Game.Stage stage, ProcedureBase procedure = null) { MapFormParams param = ReferencePool.Acquire <MapFormParams>(); param.UIForm = uIForm; param.Stage = stage; return(param); }
protected internal override void OnOpen(object userData) { base.OnOpen(userData); MapFormParams param = (MapFormParams)userData; if (param != null) { Log.Info(param.Stage); ReferencePool.Release(param); } }
private void button2_Click(object sender, EventArgs e) { MapFormParams LeoPass = new MapFormParams(); LeoPass.longitude = 0; LeoPass.latitude = 0; LeoPass.radius = 50; LeoPass.apiKey = "AIzaSyCxAKDi4ZgokHWCYK_5sQ8Dg-nlcLT2myo"; LeoPass.connectionString = "Data Source=StationGeoData.db"; int StationId; int.TryParse(textBox4.Text.ToString().Trim(), out StationId); Maps.Form2 tex = new Maps.Form2(LeoPass, StationId); tex.ShowDialog(); //tex.GleoPass.address MessageBox.Show(tex.GleoPass.address + " " + tex.GleoPass.name + " " + tex.GleoPass.brand_id.ToString() + " " + tex.GleoPass.id.ToString()); }
private void btnGeostation_Click(object sender, EventArgs e) { //Αν είναι 0, με τις συντεταγμένες ψάξε πρατήρια όπως στο PumpInfo //Αν έχει Id, δείξε το χάρτη και βάλε το marker στο πρατήριο που έχει επιλέξει // Αν το αλλάξει κράτα το νέο, αλλιώς μην κάνεις τίποτα if (dgvReceiptData.SelectedRows.Count > 0) { int extraDataId = Convert.ToInt32(dgvReceiptData.SelectedRows[0].Cells["ExtraDataId"].Value); int geostId = Convert.ToInt32(dgvReceiptData.SelectedRows[0].Cells["GeostationId"].Value.ToString().Trim()); /* * if (geostId == 10) //New Station * { * //...Φόρμα νέου σημείου / πρατηρίου * //btnNewGeoPoint_Click(this, EventArgs.Empty); * //if (((Control)sender).GetType().Name.ToUpper() == "TEXTBOX") * * string Latitude = dgvReceiptData.SelectedRows[0].Cells["RealLat"].Value.ToString().Trim(); * string Longitude = dgvReceiptData.SelectedRows[0].Cells["RealLong"].Value.ToString().Trim(); * String DecSep = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; * if (DecSep == ",") * { * Latitude = Latitude.Replace('.', ','); * Longitude = Longitude.Replace('.', ','); * } * else * { * Latitude = Latitude.Replace(',', '.'); * Longitude = Longitude.Replace(',', '.'); * } * CreateNewGeoPoint(Convert.ToDouble(Latitude), Convert.ToDouble(Longitude)); * * //GeoData * //Id = from "select max id + 1 " * //Address, Address2, Address3, Postal-Code, Country = from "geocoding" * //Latitude = dgvReceiptData.SelectedRows[0].Cells["RealLat"].Value.ToString().Trim() //+ replace * //Longitude = dgvReceiptData.SelectedRows[0].Cells["RealLong"].Value.ToString().Trim() //+ replace * //Active = 1 * * //TimeDependData * //Id = from "select max id + 1 " * //upddate = getdate() * //current_rec = 1 * //comp_name = dgvReceiptData.SelectedRows[0].Cells["Dealer"].Value.ToString() * //company_id = ?????? - id from station_Companies * } */ //else //xxxx=Defined & 0=Not Defined //{ string Lat = "", Long = ""; if (geostId > 0 && geostId != 10) { //geostation lat long Coordinates GeoLatLong = DbUtilities.GetGeostationLatLong(geostId); Lat = GeoLatLong.latitude; Long = GeoLatLong.longitude; } else //0 & 10 { //string Lat = dgvReceiptData.SelectedRows[0].Cells["Latitude"].Value.ToString().Trim().Replace('.', ','); //string Long = dgvReceiptData.SelectedRows[0].Cells["Longitude"].Value.ToString().Trim().Replace('.', ','); Lat = dgvReceiptData.SelectedRows[0].Cells["RealLat"].Value.ToString().Trim(); //.Replace('.', ','); Long = dgvReceiptData.SelectedRows[0].Cells["RealLong"].Value.ToString().Trim(); //.Replace('.', ','); } String DecSep = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; if (DecSep == ",") { Lat = Lat.Replace('.', ','); Long = Long.Replace('.', ','); } else { Lat = Lat.Replace(',', '.'); Long = Long.Replace(',', '.'); } MapFormParams MapObj = new MapFormParams() { latitude = Convert.ToDouble(Lat), //dgvCurrentObj["latitude", 0].Value.ToString().Replace('.', ',')), //38.2682, longitude = Convert.ToDouble(Long), //dgvCurrentObj["longitude", 0].Value.ToString().Replace('.', ',')), //21.755, radius = 350, //meters apiKey = MapsApi.key, //"AIzaSyCxAKDi4ZgokHWCYK_5sQ8Dg-nlcLT2myo" connectionString = SqlDBInfo.connectionString, //Stationsdb.db existsInternetConnection = NetworkConnections.CheckInternetConnection() }; //map form //SearchPlace frmMap = new SearchPlace(MapObj, true); Form2 frmMap = new Form2(MapObj, true); frmMap.ShowDialog(); if (frmMap.GleoPass.id > 0) //point selected { DialogResult dialogResult = MessageBox.Show("Είστε σίγουροι ότι θέλετε να καταχωρηθεί το πρατήριο στη συγκεκριμένη εγγραφή;", "Καταχώρηση Πρατηρίου", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { DbUtilities dbu = new DbUtilities(); if (dbu.update_extraData_geostationId(extraDataId, frmMap.GleoPass.id)) { MessageBox.Show("Το σημείο καταχωρήθηκε επιτυχώς!"); dgvReceiptData.SelectedRows[0].Cells["GeostationId"].Value = frmMap.GleoPass.id; } } } else if (geostId == 10) //new point (gas station) { CreateNewGeoPoint(); } frmMap.Dispose_gMap(); //} } }