예제 #1
0
        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));
        }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }