예제 #1
0
        void SaveCommandExecute()
        {
            newRun = new ArenaRunViewModel();
            newRun.Hero = this.NewHero;
            newRun.Wins = this.NewWins;
            newRun.Losses = this.NewLosses;
            newRun.Date = this.NewDate;

            //update DB
            HSARunsDataContext db = new HSARunsDataContext();
            var zzNewRun = new zzArenaRun { Hero = NewHero, Wins = NewWins, Losses = NewLosses, RunDate = NewDate };
            db.zzArenaRuns.InsertOnSubmit(zzNewRun);
            db.SubmitChanges();

            var newPrimaryKey = zzNewRun.RunID;

            newRun.ID = newPrimaryKey;

            MessageBox.Show("Changes have been committed to the database.");

            //update local main view model
            newRunList.Add(newRun);

            mainWindowReference.ViewModel = mainWindowReference;
        }
예제 #2
0
 partial void UpdatezzArenaRun(zzArenaRun instance);
예제 #3
0
 partial void DeletezzArenaRun(zzArenaRun instance);
예제 #4
0
 partial void InsertzzArenaRun(zzArenaRun instance);