public IActionResult UbahPertanyaanAkademik(CrudPertanyaanAkademikModel model) { if (!ModelState.IsValid) { ViewBag.Pesan = "Data tidak valid"; return(View()); } else { var newData = new Pertanyaan() { SoalId = model.SoalId, Id = model.Id, Isi = model.Isi, OpsiA = model.OpsiA, OpsiB = model.OpsiB, OpsiC = model.OpsiC, OpsiD = model.OpsiD, OpsiE = model.OpsiE, Jawaban = model.Jawaban }; _soalService.UpdatePertanyaan(newData); return(RedirectToAction(nameof(RincianSoalAkademik), new { id = model.SoalId })); } }
public IActionResult TambahPertanyaanWawancara(RincianSoalWawancaraModel model) { if (!ModelState.IsValid) { TempData["Pesan"] = "Data tidak valid"; } else { var newPertanyaan = new Pertanyaan() { SoalId = model.Id, Isi = model.CrudPertanyaanWawancara.Isi }; _soalService.AddPertanyaan(newPertanyaan); } return(RedirectToAction(nameof(RincianSoalWawancara), new { id = model.Id })); }
public IActionResult TambahPertanyaanAkademik(CrudPertanyaanAkademikModel model) { if (!ModelState.IsValid) { return(View()); } else { var newPertanyaan = new Pertanyaan() { SoalId = model.SoalId, Isi = model.Isi, OpsiA = model.OpsiA, OpsiB = model.OpsiB, OpsiC = model.OpsiC, OpsiD = model.OpsiD, OpsiE = model.OpsiE, Jawaban = model.Jawaban }; _soalService.AddPertanyaan(newPertanyaan); return(RedirectToAction(nameof(RincianSoalAkademik), new { id = model.SoalId })); } }