Пример #1
0
 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 }));
     }
 }
Пример #2
0
 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 }));
 }
Пример #3
0
 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 }));
     }
 }