private void DropDown_FormClosed(object sender, FormClosedEventArgs e) { JakubWoszczyna_Score sc = (from element in context.JakubWoszczyna_Scores where element.ID == playerId select element).FirstOrDefault(); sc.PointsNumber += score; context.SubmitChanges(); }
/// <summary> /// Dodanie nowego gracza do bazy danych, metoda zwraca ID tego gracza /// </summary> /// <returns></returns> private int AddPlayer() { var score = new JakubWoszczyna_Score { PlayerName = playerName, PointsNumber = 0 }; context.JakubWoszczyna_Scores.InsertOnSubmit(score); context.SubmitChanges(); return(score.ID); }