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; }
partial void UpdatezzArenaRun(zzArenaRun instance);
partial void DeletezzArenaRun(zzArenaRun instance);
partial void InsertzzArenaRun(zzArenaRun instance);