Beispiel #1
0
        public void AddScore(string username, double score)
        {
            DateTime  date = DateTime.Now;
            HighScore obj  = new HighScore();

            obj.UserName  = username;
            obj.BestScore = Math.Round(score);
            obj.Date      = date;

            try
            {
                dbContext.GetTable <HighScore>().InsertOnSubmit(obj);
                dbContext.SubmitChanges();
                Console.WriteLine("Submitted: " + username + " " + score + " " + date);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
 partial void UpdateHighScore(HighScore instance);
 partial void DeleteHighScore(HighScore instance);
 partial void InsertHighScore(HighScore instance);