Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GET: /Answer/Create
- public ActionResult Create()
- {
- ViewBag.Ksiazki = new SelectList(db.Ksiazki, "Tytul", "Tytul");
- ViewBag.Ksiazki = new SelectList(db.Klienci, "Imie", "Imie");
- return View();
- }
- //
- // POST: /Answer/Create
- [HttpPost]
- public ActionResult Create(Ksiazka answer)
- {
- if (ModelState.IsValid)
- {
- db.Ksiazki.Add(answer);
- db.SaveChanges();
- return RedirectToAction("Index");
- }
- ViewBag.Ksiazki = new SelectList(db.Ksiazki, "Tytul", "Tytyl", answer.Tytul);
- return View(answer);
- }
- public ActionResult Create(Klient answer)
- {
- if (ModelState.IsValid)
- {
- db.Klienci.Add(answer);
- db.SaveChanges();
- return RedirectToAction("Index");
- }
- ViewBag.Klienci = new SelectList(db.Klienci, "Imie", "Imie", answer.Imie);
- return View(answer);
- }
Add Comment
Please, Sign In to add comment