Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id_Return,nama_pengembali,tanggal_pengembalian,Id_Borrow,ket")] Return @return)
        {
            if (id != @return.Id_Return)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(@return);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReturnExists(@return.Id_Return))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(@return));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id_Borrow,nama_peminjam,tanggal_pinjam,Id_Book,lama_pinjam")] Borrow borrow)
        {
            if (id != borrow.Id_Borrow)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(borrow);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BorrowExists(borrow.Id_Borrow))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(borrow));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id_Publisher,penerbit,alamat,pemimpin")] Publisher publisher)
        {
            if (id != publisher.Id_Publisher)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(publisher);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PublisherExists(publisher.Id_Publisher))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(publisher));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id_Book,genre,jumlah,judul,Id_Author,Id_Publisher")] Book book)
        {
            if (id != book.Id_Book)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(book);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BookExists(book.Id_Book))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(book));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id_Author,penulis,umur,asal,pena,hobi")] Author author)
        {
            if (id != author.Id_Author)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(author);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AuthorExists(author.Id_Author))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(author));
        }