Example #1
0
        public ActionResult Create([Bind(Include = "CompanyRelationshipTypeId,CompanyRelationshipTypeName")] CompanyRelationshipType companyRelationshipType)
        {
            if (ModelState.IsValid)
            {
                db.CompanyRelationshipTypes.Add(companyRelationshipType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(companyRelationshipType));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "GameCompanyId,GameCompanyName")] GameCompany gameCompany)
        {
            if (ModelState.IsValid)
            {
                db.GameCompanies.Add(gameCompany);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gameCompany));
        }
Example #3
0
        public ActionResult Create([Bind(Include = "GameRegionId,GameRegionName")] GameRegion gameRegion)
        {
            if (ModelState.IsValid)
            {
                db.GameRegions.Add(gameRegion);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gameRegion));
        }
        public ActionResult Create([Bind(Include = "GameOwnerId,GameOwnerName,OwnerUserId")] GameOwner gameOwner)
        {
            if (ModelState.IsValid)
            {
                db.GameOwners.Add(gameOwner);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gameOwner));
        }
Example #5
0
        public ActionResult Create([Bind(Include = "PlatformId,PlatformName,CompanyId")] Platform platform)
        {
            if (ModelState.IsValid)
            {
                db.Platforms.Add(platform);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompanyId = new SelectList(db.GameCompanies, "GameCompanyId", "GameCompanyName", platform.CompanyId);
            return(View(platform));
        }
        public ActionResult Create([Bind(Include = "CompanyRelationshipId,CompanyRelationshipTypeId,FromCompany,ToCompany")] CompanyRelationship companyRelationship)
        {
            if (ModelState.IsValid)
            {
                db.CompanyRelationships.Add(companyRelationship);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.FromCompany = new SelectList(db.GameCompanies, "GameCompanyId", "GameCompanyName", companyRelationship.FromCompany);
            ViewBag.ToCompany   = new SelectList(db.GameCompanies, "GameCompanyId", "GameCompanyName", companyRelationship.ToCompany);
            ViewBag.CompanyRelationshipTypeId = new SelectList(db.CompanyRelationshipTypes, "CompanyRelationshipTypeId", "CompanyRelationshipTypeName", companyRelationship.CompanyRelationshipTypeId);
            return(View(companyRelationship));
        }
Example #7
0
        public ActionResult Create([Bind(Include = "GameId,PlatformId,Title,DeveloperId,RegionId,PublisherId,HasCase,HasManual,ModelName,HasAccessory,OwnerId,Notes")] Game game)
        {
            if (ModelState.IsValid)
            {
                db.Games.Add(game);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DeveloperId = new SelectList(db.GameCompanies, "GameCompanyId", "GameCompanyName", game.DeveloperId);
            ViewBag.PublisherId = new SelectList(db.GameCompanies, "GameCompanyId", "GameCompanyName", game.PublisherId);
            ViewBag.RegionId    = new SelectList(db.GameRegions, "GameRegionId", "GameRegionName", game.RegionId);
            ViewBag.PlatformId  = new SelectList(db.Platforms, "PlatformId", "PlatformName", game.PlatformId);
            ViewBag.OwnerId     = new SelectList(db.GameOwners, "GameOwnerId", "GameOwnerName", game.OwnerId);
            return(View(game));
        }