private void BtnAdd(object sender, MouseButtonEventArgs e) { var db = new GameHalldbEntities(); var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); var secondLast = DateTime.Now.Subtract(DateTime.MinValue).TotalSeconds; var newPlaying = new playing { startTime = Convert.ToDateTime(time), description = information.Text, status = false, place = Convert.ToInt32(table.Text), startTimeInSecond = secondLast }; db.playings.Add(newPlaying); if (Convert.ToBoolean(db.SaveChanges())) { success.Opacity = 1; } else { noSuccess.Opacity = 0; } }
// Use this for initialization void Start() { play = this; Invoke("ReStrat", 0.1f); }