예제 #1
0
        public ActionResult Create([Bind(Include = "genre_id,genre_title")] genres genres)
        {
            if (ModelState.IsValid)
            {
                db.genres.Add(genres);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(genres));
        }
        public ActionResult Create([Bind(Include = "show_id,show_title,num_seasons,initial_year")] shows shows)
        {
            if (ModelState.IsValid)
            {
                db.shows.Add(shows);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(shows));
        }
예제 #3
0
        public ActionResult Create([Bind(Include = "person_id,first_name,last_name,account_type,dob,compress_pass,hash_pass,enc_pass")] people people)
        {
            if (ModelState.IsValid)
            {
                db.people.Add(people);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(people));
        }
        public ActionResult Create([Bind(Include = "character_id,character_name,race_id")] characters characters)
        {
            if (ModelState.IsValid)
            {
                db.characters.Add(characters);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(characters));
        }
예제 #5
0
        public ActionResult Create([Bind(Include = "id,firstname,lastname")] director director)
        {
            if (ModelState.IsValid)
            {
                db.director.Add(director);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(director));
        }
예제 #6
0
        public ActionResult Create([Bind(Include = "race_id,race_name")] races races)
        {
            if (ModelState.IsValid)
            {
                db.races.Add(races);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(races));
        }
        public ActionResult Create([Bind(Include = "product_id,product_name,product_category,product_price,product_sku,short_description,idx_sku,idx_names,idx_sku_three")] products products)
        {
            if (ModelState.IsValid)
            {
                db.products.Add(products);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(products));
        }
        public ActionResult Create([Bind(Include = "movie_id,movie_title,director,year,genre_id")] movies movies)
        {
            if (ModelState.IsValid)
            {
                db.fillmoviesTable(movies.director, movies.genre_id, movies.movie_id, movies.movie_title, movies.year);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(movies));
        }
예제 #9
0
        public ActionResult Create([Bind(Include = "movie_id,movie_title,director,year,genre_id")] MoviesTable moviesTable)
        {
            if (ModelState.IsValid)
            {
                db.MoviesTable.Add(moviesTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(moviesTable));
        }
        public ActionResult Create([Bind(Include = "tv_id,tv_title,num_seasons")] tv tv)
        {
            if (ModelState.IsValid)
            {
                db.tv.Add(tv);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tv));
        }
예제 #11
0
        public ActionResult Register(User registeruser)
        {
            if (ModelState.IsValid)
            {
                bool isValidUser = entity.Users.Any(u => u.UserName ==
                                                    registeruser.UserName || u.EmailId == registeruser.EmailId || u.PhoneNumber == registeruser.PhoneNumber);

                if (!isValidUser)
                {
                    entity.Users.Add(registeruser);
                    entity.SaveChanges();
                    return(RedirectToAction("Login"));
                }
            }
            ModelState.AddModelError("", "User already exist,Use another Username or Password or Email");
            return(View());
        }