public IActionResult Delete(Guid id) { Seminar seminar = _seminarService.GetSeminarById(id); SeminarCreateViewModel model = new SeminarCreateViewModel { Description = seminar.Description, Title = seminar.Title, Content = seminar.Content }; return(View(model)); }
public ActionResult Edit(SeminarCreateViewModel model, Guid id) { if (ModelState.IsValid) { var x = model; Seminar seminar = new Seminar { Id = model.Id, Title = model.Title, Description = model.Description, Content = model.Content }; _seminarService.UpdateSeminar(seminar); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult Create(SeminarCreateViewModel model, string returnUrl = null) { ViewData["ReturnUrl"] = returnUrl; if (ModelState.IsValid) { Seminar seminar = new Seminar { Id = new System.Guid(), Title = model.Title, Description = model.Description, Content = model.Content }; _seminarService.CreateSeminar(seminar); // return View(model); } return(View(model)); }