public AssembleTrainingData GetAssemblyTrainingRecord(int id) { AssembleTrainingData sh = new AssembleTrainingData(); try { string str = "SELECT * FROM `assemblytraining` WHERE UserId=" + id; MySqlCommand comm = new MySqlCommand(str, dbConnection); comm.CommandTimeout = 30; MySqlDataReader reader = comm.ExecuteReader(); while (reader.Read()) { sh.GPA = reader.GetString(1); sh.result = reader.GetInt32(2); sh.minutes = reader.GetInt32(3); sh.seconds = reader.GetInt32(4); } reader.Close(); } catch (Exception e) { Debug.LogError("Error While Getting Training Assembly Record "); Debug.LogError(e.ToString()); ErrorDialougText.color = Color.red; ErrorDialougText.text = "there is no user with this Id to add record to it "; } return(sh); }
//Set current Changes in the Training Scene for Specific User public void SetShootingTrainingData(AssembleTrainingData trainingData) { CurrentChanesOnAssembleTrainingData.Add(trainingData); }