public ActionResult Edit(CategoryViewModel categoryModel) { if (ModelState.IsValid) { Category category = categoryModel.ToCategory(); repository.InsertOrUpdate(category, User.Identity.Name); repository.Save(); return RedirectToAction("Index"); } return View(categoryModel); }
public Meeting ToMeeting() { Meeting meeting = new Meeting(); CategoryViewModel categoryModel = new CategoryViewModel(); categoryModel = this.Category; Category category = new Category(); if (this.Category == null) { meeting.CategoryID = null; } else { category = categoryModel.ToCategory(); meeting.CategoryID = category.CategoryID; } meeting.MeetingID = this.MeetingID; meeting.Time = this.Time; meeting.Description = this.Description; meeting.Place = this.Place; return meeting; }