Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "CompId,CompPay")] Compensation compensation)
        {
            if (ModelState.IsValid)
            {
                db.Compensations.Add(compensation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(compensation));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "RegionId,RegionName")] Region region)
        {
            if (ModelState.IsValid)
            {
                db.Regions.Add(region);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(region));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "FollowerId,FollowerCount")] Follower follower)
        {
            if (ModelState.IsValid)
            {
                db.Followers.Add(follower);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(follower));
        }
Exemplo n.º 4
0
        public ActionResult Create([Bind(Include = "PostId,PostNum")] Post post)
        {
            if (ModelState.IsValid)
            {
                db.Posts.Add(post);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(post));
        }
Exemplo n.º 5
0
        public ActionResult Create([Bind(Include = "BrandId,CompanyName,Product,ProductDescription,PostId,CompId")] Brand brand)
        {
            if (ModelState.IsValid)
            {
                db.Brands.Add(brand);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompId = new SelectList(db.Compensations, "CompId", "CompPay", brand.CompId);
            ViewBag.PostId = new SelectList(db.Posts, "PostId", "PostNum", brand.PostId);
            return(View(brand));
        }
Exemplo n.º 6
0
        public ActionResult Create([Bind(Include = "SociaLId,Name,SocailMName,FollowerCountId,RegionId,CompId,Email,Image_")] SocialUser socialUser)
        {
            if (ModelState.IsValid)
            {
                db.SocialUsers.Add(socialUser);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompId          = new SelectList(db.Compensations, "CompId", "CompPay", socialUser.CompId);
            ViewBag.FollowerCountId = new SelectList(db.Followers, "FollowerId", "FollowerCount", socialUser.FollowerCountId);
            ViewBag.RegionId        = new SelectList(db.Regions, "RegionId", "RegionName", socialUser.RegionId);
            return(View(socialUser));
        }