private void button2_Click(object sender, EventArgs e) { string Server = Properties.Settings.Default.MySqlServer; string User = Properties.Settings.Default.MySqlUser; string Database = Properties.Settings.Default.mySqlDatabase; Properties.Settings.Default.mySqlDatabase = this.textBoxDatabase.Text; Properties.Settings.Default.MySqlServer = this.textBoxServer.Text; Properties.Settings.Default.MySqlUser = this.textBoxUser.Text; Properties.Settings.Default.Save(); MySqlProvider TestSql = new MySqlProvider(); if (TestSql.IsConnectionOK() == true) { MessageBox.Show("Connection is OK"); } else { MessageBox.Show("Connection FAILED"); } Properties.Settings.Default.mySqlDatabase = Database; Properties.Settings.Default.MySqlServer = Server; Properties.Settings.Default.MySqlUser = User; Properties.Settings.Default.Save(); }
public void Build_Prediction_Marker(PointLatLng Base_Position, string ACID, MySqlProvider.PredictionTableNumberType Table_Type, ref GMapOverlay Overlay) { MySqlProvider SqlProvider = new MySqlProvider(); System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> Record = SqlProvider.GetOneRecordPerTimeAndACID(Table_Type, SharedData.LookAheadTime, ACID, false); // If prediction data for the given parameters exists // then lets add it to the display list. if (Record.Count > 0) { GeoCordSystemDegMinSecUtilities.LatLongClass P_Pont = new GeoCordSystemDegMinSecUtilities.LatLongClass(double.Parse(Record[0].Lat), double.Parse(Record[0].Lon)); PointLatLng PredictedPoint = new PointLatLng(P_Pont.GetLatLongDecimal().LatitudeDecimal, P_Pont.GetLatLongDecimal().LongitudeDecimal); PredictionMarker PM; string label = Record[0].ACID + "\n" + Record[0].Time.ToShortTimeString(); switch (Table_Type) { case MySqlProvider.PredictionTableNumberType.One: PM = new PredictionMarker(Base_Position, Color.Magenta, PredictedPoint, label); Overlay.Markers.Add(PM); break; case MySqlProvider.PredictionTableNumberType.Two: PM = new PredictionMarker(Base_Position, Color.Blue, PredictedPoint, label); Overlay.Markers.Add(PM); break; case MySqlProvider.PredictionTableNumberType.Three: PM = new PredictionMarker(Base_Position, Color.Orange, PredictedPoint, label); Overlay.Markers.Add(PM); break; } } }
// This method returns one distinct record of data for the specified time and ACID private System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> GetOneRecordPerTimeAndACID() { MySqlProvider MySQL = new MySqlProvider(); TimeSpan TimeToAdd = new TimeSpan((int)this.numericUpDownHrs.Value, (int)this.numericUpDownMin.Value, 0); return(MySQL.GetOneRecordPerTimeAndACID(GetTableChoice(), TimeToAdd, this.comboBoxACID.Text, true)); }
// This method returns a list of ALL available data from the pre-selected table // for the given DateTime.It is then up to the user to decide what data to use private System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> GetAllDataForDateTime() { MySqlProvider MySQL = new MySqlProvider(); TimeSpan TimeToAdd = new TimeSpan((int)this.numericUpDownHrs.Value, (int)this.numericUpDownMin.Value, 0); return(MySQL.GetAllDataForTime(GetTableChoice(), TimeToAdd, true)); }
//DateTimeOut = "'2013-1-29 10:14:00'"; public static string BuildMySqlDateTimeString(TimeSpan TimeToAdd, bool Is_DBM_Lookup, MySqlProvider.PredictionTableNumberType Table) { DateTime T; if (SharedData.UseDBM_Replay_Time == false) { T = DateTime.UtcNow + TimeToAdd; } else { if (Is_DBM_Lookup) { MySqlProvider MySQL = new MySqlProvider(); System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> DataRetreived = MySQL.GetFirstTimeFromTable(Table); T = DataRetreived[0].Time + TimeToAdd; } else { T = P_Test.TimeHanlder.GetDBMTime() + TimeToAdd; } } string DateTimeOut = "'" + T.Year.ToString() + "-" + T.Month + "-" + T.Day.ToString() + " " + T.Hour.ToString() + ":" + T.Minute.ToString() + ":" + T.Second.ToString() + "'"; return(DateTimeOut); }
public static void StartSession() { SessionStartTime = DateTime.UtcNow; SessionActive = true; MySqlProvider MySQL = new MySqlProvider(); System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> DataRetreived = MySQL.GetFirstTimeFromTable(MySqlProvider.PredictionTableNumberType.One); DBM_Start_Time = DataRetreived[0].Time; }
public static void StartSession() { SessionStartTime = DateTime.UtcNow; SessionActive = true; MySqlProvider MySQL = new MySqlProvider(); System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> DataRetreived = MySQL.GetFirstTimeFromTable(MySqlProvider.PredictionTableNumberType.One); DBM_Start_Time = DataRetreived[0].Time; }
//DateTimeOut = "'2013-1-29 10:14:00'"; public static string BuildMySqlDateTimeString(TimeSpan TimeToAdd, bool Is_DBM_Lookup, MySqlProvider.PredictionTableNumberType Table) { DateTime T; if ( SharedData.UseDBM_Replay_Time == false) T = DateTime.UtcNow + TimeToAdd; else { if (Is_DBM_Lookup) { MySqlProvider MySQL = new MySqlProvider(); System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> DataRetreived = MySQL.GetFirstTimeFromTable(Table); T = DataRetreived[0].Time + TimeToAdd; } else T = P_Test.TimeHanlder.GetDBMTime() + TimeToAdd; } string DateTimeOut = "'" + T.Year.ToString() + "-" + T.Month + "-" + T.Day.ToString() + " " + T.Hour.ToString() + ":" + T.Minute.ToString() + ":" + T.Second.ToString() + "'"; return DateTimeOut; }
private void button2_Click(object sender, EventArgs e) { string Server = Properties.Settings.Default.MySqlServer; string User = Properties.Settings.Default.MySqlUser; string Database = Properties.Settings.Default.mySqlDatabase; Properties.Settings.Default.mySqlDatabase = this.textBoxDatabase.Text; Properties.Settings.Default.MySqlServer = this.textBoxServer.Text; Properties.Settings.Default.MySqlUser = this.textBoxUser.Text; Properties.Settings.Default.Save(); MySqlProvider TestSql = new MySqlProvider(); if (TestSql.IsConnectionOK() == true) MessageBox.Show("Connection is OK"); else MessageBox.Show("Connection FAILED"); Properties.Settings.Default.mySqlDatabase = Database; Properties.Settings.Default.MySqlServer = Server; Properties.Settings.Default.MySqlUser = User; Properties.Settings.Default.Save(); }
public void Build_Prediction_Marker(PointLatLng Base_Position, string ACID, MySqlProvider.PredictionTableNumberType Table_Type, ref GMapOverlay Overlay) { MySqlProvider SqlProvider = new MySqlProvider(); System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> Record = SqlProvider.GetOneRecordPerTimeAndACID(Table_Type, SharedData.LookAheadTime, ACID, false); // If prediction data for the given parameters exists // then lets add it to the display list. if (Record.Count > 0) { GeoCordSystemDegMinSecUtilities.LatLongClass P_Pont = new GeoCordSystemDegMinSecUtilities.LatLongClass(double.Parse(Record[0].Lat), double.Parse(Record[0].Lon)); PointLatLng PredictedPoint = new PointLatLng(P_Pont.GetLatLongDecimal().LatitudeDecimal, P_Pont.GetLatLongDecimal().LongitudeDecimal); PredictionMarker PM; string label = Record[0].ACID + "\n" + Record[0].Time.ToShortTimeString(); switch (Table_Type) { case MySqlProvider.PredictionTableNumberType.One: PM = new PredictionMarker(Base_Position, Color.Magenta, PredictedPoint, label); Overlay.Markers.Add(PM); break; case MySqlProvider.PredictionTableNumberType.Two: PM = new PredictionMarker(Base_Position, Color.Blue, PredictedPoint, label); Overlay.Markers.Add(PM); break; case MySqlProvider.PredictionTableNumberType.Three: PM = new PredictionMarker(Base_Position, Color.Orange, PredictedPoint, label); Overlay.Markers.Add(PM); break; } } }
// This method returns one distinct record of data for the specified time and ACID private System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> GetOneRecordPerTimeAndACID() { MySqlProvider MySQL = new MySqlProvider(); TimeSpan TimeToAdd = new TimeSpan((int)this.numericUpDownHrs.Value, (int)this.numericUpDownMin.Value, 0); return MySQL.GetOneRecordPerTimeAndACID(GetTableChoice(), TimeToAdd, this.comboBoxACID.Text, true); }
// This method returns a list of ALL available data from the pre-selected table // for the given DateTime.It is then up to the user to decide what data to use private System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> GetAllDataForDateTime() { MySqlProvider MySQL = new MySqlProvider(); TimeSpan TimeToAdd = new TimeSpan((int)this.numericUpDownHrs.Value, (int)this.numericUpDownMin.Value, 0); return MySQL.GetAllDataForTime(GetTableChoice(), TimeToAdd, true); }
// This method returns a list of ALL available data from the pre-selected table // for the given ACID.It is then up to the user to decide what data to use private System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> GetAllDataForACID() { MySqlProvider MySQL = new MySqlProvider(); return MySQL.GetAllDataForACID(GetTableChoice(), this.comboBoxACID.Text); }
// This method returns a list of ALL available data from the pre-selected table // It is then up to the user to decide what data to use private System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> GetAllData() { MySqlProvider MySQL = new MySqlProvider(); return MySQL.GetAllData(GetTableChoice()); }
// This method returns a list of ALL available ACIDs from the currently selected table private System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> GetAllACIDsDataDistinct() { MySqlProvider MySQL = new MySqlProvider(); return(MySQL.GetAllACIDsDataDistinct(GetTableChoice())); }
// This method returns a list of ALL available data from the pre-selected table // for the given ACID.It is then up to the user to decide what data to use private System.Collections.Generic.List <MySqlProvider.PredictionDataSetOneRow> GetAllDataForACID() { MySqlProvider MySQL = new MySqlProvider(); return(MySQL.GetAllDataForACID(GetTableChoice(), this.comboBoxACID.Text)); }