Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        // 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));
        }
Esempio n. 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            GameMemberFilter gamememberfilter = db.GameMemberFilters.Find(id);

            db.GameMemberFilters.Remove(gamememberfilter);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        // 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;
 }