//common lib public bool Insert(season_round entity) { try { db.season_round.Add(entity); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Update(season_round entity) { try { var info = db.season_round.Find(entity.id); info.idx_round_id = entity.idx_round_id; info.idx_season_id = entity.idx_season_id; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Insert_SeasonRound(string seasonID, string roundID) { try { var info = new season_round(); info.idx_season_id = seasonID; info.idx_round_id = roundID; db.season_round.Add(info); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public ActionResult Create(season_round seasonRound) { if (ModelState.IsValid) { var dao = new season_round_dao(); var result = dao.Insert(seasonRound); if (result) { SetAlert(StaticResources.Resources.Pub_InsertSuccess, "success"); return(RedirectToAction("Index", "Match", new { season_id = seasonRound.idx_season_id })); } else { ModelState.AddModelError("", StaticResources.Resources.InsertSeasonRoundFailed); } } SetListRound(seasonRound.idx_round_id); SetListSeason(seasonRound.idx_season_id); return(View()); }