private void AddPlayoffGame(int scheduleNo) { using (var db = new CSBCDbContext()) { var rep = new SchedulePlayoffRepository(db); var game = new SchedulePlayoff(); try { game.ScheduleNumber = scheduleNo; game.GameDate = (DateTime)ConcatDateTime(mskDate.Text, txtTime.Text); game.GameTime = txtTime.Text; game.HomeTeam = txtHome.Text; game.VisitingTeam = txtVisitor.Text; game.LocationNumber = Convert.ToInt32(cmbVenues.SelectedItem.Value); game.Descr = txtDescr.Text; game.DivisionId = Convert.ToInt32(ddlDivisions.SelectedValue); var newGame = rep.Insert(game); db.SaveChanges(); //this should be in UOM! GameNo = newGame.GameNumber; } catch (Exception ex) { Session["ErrorMSG"] = "ADDRow::" + ex.Message; } } }
internal static void AddPlayoffGame(int scheduleNo, DateTime? date, string gameTime, int locationNumber, string homeTeam, string visitorTeam, string description, int divisionId) { using (var db = new CSBCDbContext()) { var rep = new SchedulePlayoffRepository(db); var game = new SchedulePlayoff { ScheduleNumber = scheduleNo, GameDate = date, GameTime = gameTime, LocationNumber = locationNumber, HomeTeam = homeTeam, VisitingTeam = visitorTeam, Descr = description, DivisionId = divisionId }; rep.Insert(game); db.SaveChanges(); } }