private void AddStepGame(string step, T_Game game) { try { if (game == null) { return; } using (var db = new ChessDataBaseDataContext()) { var stepArray = step.ToCharArray(); var count = db.T_Courses.Count(q => q.GameID == game.Id) + 1; var newStep = new T_Course { Course = step, GameID = game.Id, Number = count }; if (stepArray[0] == 'w') { newStep.WhoGone = game.White; } if (stepArray[0] == 'b') { newStep.WhoGone = game.Black; } db.T_Courses.InsertOnSubmit(newStep); db.SubmitChanges(); } } catch (Exception ex) { Console.Write("AddStepGame(): "); Console.WriteLine(ex.Message); Console.ReadKey(); } }
private void detach_T_Courses(T_Course entity) { this.SendPropertyChanging(); entity.T_Game = null; }
private void attach_T_Courses(T_Course entity) { this.SendPropertyChanging(); entity.T_Game = this; }
partial void DeleteT_Course(T_Course instance);
partial void UpdateT_Course(T_Course instance);
partial void InsertT_Course(T_Course instance);