Exemple #1
0
        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();
            }
        }
Exemple #2
0
 private void detach_T_Courses(T_Course entity)
 {
     this.SendPropertyChanging();
     entity.T_Game = null;
 }
Exemple #3
0
 private void attach_T_Courses(T_Course entity)
 {
     this.SendPropertyChanging();
     entity.T_Game = this;
 }
Exemple #4
0
 partial void DeleteT_Course(T_Course instance);
Exemple #5
0
 partial void UpdateT_Course(T_Course instance);
Exemple #6
0
 partial void InsertT_Course(T_Course instance);