Beispiel #1
0
 public ActionResult Edit([Bind(Include = "ActorId,FirstName,LastName,GenreId,IsMaried")] Actor actor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(actor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(actor));
 }
 public ActionResult Edit([Bind(Include = "id,type,name,poster,area,releaseTime,price,remarks")] MovieModels movieModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movieModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movieModels));
 }
 public ActionResult Edit([Bind(Include = "Id,Original_title,Release_date,Original_Language,Description,Budget,Vote_average")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
 public ActionResult Edit([Bind(Include = "Id,ParentId,Title,Year,Rated,Released,Runtime,Genre,Director,Writer,Actors,Plot,Language,Country,Awards,Poster,Metascore,imdbRating,imdbVotes,imdbID,Type,DVD,BoxOffice,Production,Website,Response,SelectedForSave")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "PostID,UserName,Title,Snippet,Post,Category,Published,Created")] Blog blog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(blog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(blog));
 }
 public ActionResult Edit([Bind(Include = "ID,titlu,regia,distributia,dataPremiera,nrBilete,ora,dataFinal")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
 public ActionResult Edit([Bind(Include = "ID_TRENERA,ID_DRUZYNY,IMIE_TRENERA,NAZWISKO_TRENERA,WIEK_TRENERA,NARODOWOSC_TRENERA")] Trenerzy trenerzy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trenerzy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(trenerzy));
 }
 public ActionResult Edit([Bind(Include = "ID,EmployeeName,Salary,PayDate")] PayRoll payRoll)
 {
     if (ModelState.IsValid)
     {
         db.Entry(payRoll).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(payRoll));
 }
 public ActionResult Edit([Bind(Include = "ID,Title,Director,Date")] MovieDB movieDB)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movieDB).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movieDB));
 }
 public ActionResult Edit([Bind(Include = "ID_MIASTA,NAZWA_MIASTA")] Miasta miasta)
 {
     if (ModelState.IsValid)
     {
         db.Entry(miasta).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(miasta));
 }
 public ActionResult Edit([Bind(Include = "ID_PILKARZA,ID_SPOTKANIA,ID_DRUZYNY,MINUTA_KARY,KARA")] Kary kary)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kary).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kary));
 }
Beispiel #12
0
 public ActionResult Edit([Bind(Include = "ID_DRUZYNY,ID_MIASTA,NAZWA_DRUZYNY,PUNKTY,BRAMKI,ILOSC_SPOTKAN")] Druzyny druzyny)
 {
     if (ModelState.IsValid)
     {
         db.Entry(druzyny).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(druzyny));
 }
Beispiel #13
0
 public ActionResult Edit([Bind(Include = "ID,CreatedBy,EquipmentName,ReleaseDate,TypeofAssets,Barcode,Location,RoomName")] excel excel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(excel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(excel));
 }
Beispiel #14
0
 public ActionResult Edit([Bind(Include = "ID,Name,ReleaseDate,Location,Barcode,Type,CreatedBy,roomName")] Asset asset)
 {
     if (ModelState.IsValid)
     {
         db.Entry(asset).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(asset));
 }
Beispiel #15
0
 public ActionResult Edit(Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
 public ActionResult Edit([Bind(Include = "Id,Title,ReleaseDate,Price,Rating,TmdbId,VoteCount,VoteAverage,Overview,PosterPath")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #17
0
 public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price,Rating")] Movie movie) //MVC model binder takes the posted form values and creates a Movie
 {                                                                                                 //object that's passed as the movie parameter
     if (ModelState.IsValid)                                                                       //ModelState.IsValid method verifies that the data submitted in the form can be used to modify (edit or update) a Movie object
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #18
0
 public ActionResult Edit([Bind(Include = "ID,Name")] Genre genre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(genre));
 }
Beispiel #19
0
 public ActionResult Edit([Bind(Include = "ID,AddressStore")] Address address)
 {
     if (ModelState.IsValid)
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(address));
 }
Beispiel #20
0
 public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price,Rating")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #21
0
 public ActionResult Edit([Bind(Include = "Id,MovieName,ReleaseDate,Director,Writers,Actors,Description,Like")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #22
0
 public ActionResult Edit(Movie movie)
 {
     if (ModelState.IsValid)
     {
         //he ModelState.IsValid method verifies that the data submitted in the form can be used to modify (edit or update) a Movie object. If the data is valid, the movie data is saved to the Movies collection of the db(MovieDBContext instance). The new movie data is saved to the database by calling the SaveChanges method of MovieDBContext.
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #23
0
        public async Task <ActionResult> Edit([Bind(Include = "RentID,UserID,MovieID,From,To")] Rent rent)
        {
            if (ModelState.IsValid)
            {
                db.Entry(rent).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(rent));
        }
Beispiel #24
0
 public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price")] Movie movie)
 {
     // 模型状态, 用户输入验证失败后该值= false
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;       // 一种更新模型数据的方式
         db.SaveChanges();                                   // 将模型内的数据更新到数据库
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
        public async Task <ActionResult> Edit([Bind(Include = "ID,Name,Genra,Price,Date")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                db.Entry(movie).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(movie));
        }
Beispiel #26
0
        public async Task <ActionResult> Edit([Bind(Include = "GenreID,Type")] Genre genre)
        {
            if (ModelState.IsValid)
            {
                db.Entry(genre).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(genre));
        }
Beispiel #27
0
 public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price,RatingID")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         ViewBag.RatingID = new SelectList(db.Ratings, "ID", "RatingName", movie.RatingID);
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Beispiel #28
0
 public ActionResult Edit([Bind(Include = "Id,MovieID,Name,Street,City,Date")] Cinema cinema)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cinema).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MovieID = new SelectList(db.Movies, "ID", "Title", cinema.MovieID);
     return(View(cinema));
 }
        public async Task <ActionResult> Edit([Bind(Include = "UserID,Name")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Entry(user).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(user));
        }
Beispiel #30
0
        public ActionResult Edit([Bind(Include = "ID,Date,CustomerName,BillingAddress,Product,Total")] PurchaseOrder purchaseOrder)
        {
            purchaseOrder.EmployeeName = User.Identity.Name;

            if (ModelState.IsValid)
            {
                db.Entry(purchaseOrder).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(purchaseOrder));
        }