public ActionResult Create([Bind(Include = "GameMemberFilterID,GameID,CountryID,StateID,CityID,AgeBandID,GenderID,Territory,MemberSubscriptionTypeID")] GameMemberFilter gamememberfilter) { List <SelectListItem> AgeGroups; List <SelectListItem> Genders; GetAgesAndGenders(out AgeGroups, out Genders); if (ModelState.IsValid) { db.GameMemberFilters.Add(gamememberfilter); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AgeBandID = new SelectList(AgeGroups, "Value", "Text"); ViewBag.GenderID = new SelectList(Genders, "Value", "text"); ViewBag.GameID = new SelectList(db.Games, "GameID", "GameCode"); ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "CountryName"); ViewBag.StateID = new SelectList(db.CountryStates, "StateID", "StateName"); ViewBag.Territory = new SelectList(db.Territories, "TerritoryID", "TerritoryCode"); ViewBag.MemberSubscriptionTypeID = new SelectList(db.MemberSubscriptionTypes, "MemberSubscriptionTypeID", "MemberSubscriptionTypeCode"); return(View(gamememberfilter)); }
// GET: /GameMemberFilter/Edit/5 public ActionResult Edit(int?id) { List <SelectListItem> AgeGroups; List <SelectListItem> Genders; GetAgesAndGenders(out AgeGroups, out Genders); ViewBag.AgeBandID = new SelectList(AgeGroups, "Value", "Text"); ViewBag.GenderID = new SelectList(Genders, "Value", "text"); ViewBag.GameID = new SelectList(db.Games, "GameID", "GameCode"); ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "CountryName"); ViewBag.StateID = new SelectList(db.CountryStates, "StateID", "StateName"); ViewBag.Territory = new SelectList(db.Territories, "TerritoryID", "TerritoryCode"); ViewBag.MemberSubscriptionTypeID = new SelectList(db.MemberSubscriptionTypes, "MemberSubscriptionTypeID", "MemberSubscriptionTypeCode"); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GameMemberFilter gamememberfilter = db.GameMemberFilters.Find(id); if (gamememberfilter == null) { return(HttpNotFound()); } return(View(gamememberfilter)); }
public ActionResult DeleteConfirmed(int id) { GameMemberFilter gamememberfilter = db.GameMemberFilters.Find(id); db.GameMemberFilters.Remove(gamememberfilter); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: /GameMemberFilter/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GameMemberFilter gamememberfilter = db.GameMemberFilters.Find(id); if (gamememberfilter == null) { return(HttpNotFound()); } return(View(gamememberfilter)); }
public GameMemberFilterViewModel(GameMemberFilter gmf) { this.GameMemberFilter = gmf; }